Giter Site home page Giter Site logo

davideas / grabver Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 11.0 169 KB

Gradle Automatic Build Versioning Plugin - An easy Gradle plugin that follows semver.org rules to automatically generate the Patch version, Build number and Code version, while Major, Minor and Pre-Release suffix remain under our control.

License: Apache License 2.0

Groovy 92.09% Java 7.91%
android-studio auto-reset automatic-versioning build build-versioning gradle intellij-idea semver version versioning

grabver's People

Contributors

davideas avatar jrcacd avatar mastito03 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grabver's Issues

Trigger increment patch by different task

Thanks for the great tool!

Is there a way to trigger the increment of the patch by a custom task?

e.g. for a plain java application, it would be great if the patch would increment on each 'build' or 'jar'... i tried build.dependsOn(grabverRelease), but that doesn't seem to work at all...
[my usecase: while developing, i just run my application (application::run), but to distribute the software, i use a jar (java::jar).]

I had some hope, when I found the dependsOn parameter in versioning, but that doesn't seem to help, either... wouldn't it possible to have a parameter that i can set to 'jar' for example, and then on each jar building, the patch gets incremented?

support for this usecase would be great - thanks!

empty version.properties

Generated version.properties file is empty on first run.

gradlew -version

------------------------------------------------------------

Build time:   2019-03-20 11:03:29 UTC
Revision:     f5c64796748a98efdbf6f99f44b6afe08492c2a0

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_131 (Oracle Corporation 25.131-b11)
OS:           Windows 10 10.0 amd64

build output

> Configure project :
====== STARTED GrabVer v1.0.1
INFO - ProjectName 'gradle-versioning'
INFO - Versioning root project 'gradle-versioning'
INFO - Versioning filename 'C:\dev\peaks\bees\gradle-versioning\version.properties'
INFO - Current versioning 0.0.0 #0 code=1
INFO - runTasks=[grabverRelease]
INFO - Running with release build => 'Code' version will auto increment

Can the name of the output file be formated too?

First I want to say, this project is very, very good.
Very easy to use, and very well designed.

Now, the question:
Can the name of the output file be formated too?
For example to have the versioning.name variable content.
Ex: 1.1.0-RC1.apk

Configure console color and info

Would it be possible to add configurations regarding console color and info.

For starters just enable/disable console color.
And enable/disable console info.

Does not clear preRelease

When set preRelease and then coment the line on build.gradle the prerelease still is in the apk.
We have to ser prerelease = "", and then coment the prerelease line

android.defaultConfig.versionCode is set to 0, but it should be a positive integer.

I got a build failed when configuring project after upgrade Android Studio to 3.3 canary 5 and android-gradle-plugin to 3.3.0-alpha 05

A problem occurred configuring project ':app'.
android.defaultConfig.versionCode is set to 0, but it should be a positive integer.
See https://developer.android.com/studio/publish/versioning#appversioning for more information.

android studio version -> 3.3 canary 5
gradle version -> 4.9
android-gradle-plugin -> 3.3.0-alpha 05

build.gradle in app :

versioning {
// required (number)
major = 1
minor = 0
// force patch, optional (number)
patch = 0
dependsOn = "install"
// optional (any string)
preRelease = 'SNAPSHOT'
}

defaultConfig {
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode versioning.code
versionName versioning.name
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Gradle Plugins repository doesn't work whereas Bintray works

Adding:

maven { url "https://plugins.gradle.org/m2/" }

and

classpath 'gradle.plugin.eu.davidea:grabver:1.0.0'

gives error:

Could not find gradle.plugin.eu.davidea:grabver:1.0.0.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.pom
  - https://repo.maven.apache.org/maven2/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.jar
  - https://jcenter.bintray.com/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.pom
  - https://jcenter.bintray.com/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.jar
  - https://dl.google.com/dl/android/maven2/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.pom
  - https://dl.google.com/dl/android/maven2/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.jar
  - https://maven.fabric.io/public/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.pom
  - https://maven.fabric.io/public/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.jar
  - https://plugins.gradle.org/m2/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.pom
  - https://plugins.gradle.org/m2/gradle/plugin/eu/davidea/grabver/1.0.0/grabver-1.0.0.jar

Wheras adding:

 maven { url "http://dl.bintray.com/davideas/maven" }

and

classpath 'eu.davidea:grabver:1.0.0'

works with no problems.

It there a way to set directly the patch number in gradle?

versioning {
    major = 2
    minor = 1
    patch = 7 //This part
}

The motive is that I have a list with the versions numbers, and respective changelog.
I want to set the major, minor and patch directelly from the last record os my list.

The GrabVer still need to update the build number

Patch is not being increased in release

versioning {
    major = 0
    minor = 12
}

It generates:

#Mon Sep 25 10:04:58 BST 2017
CODE=0
MAJOR=0
MINOR=12
BUILD=17
PATCH=3
PRE_RELEASE=

If I delete the PRE_RELEASE= , it recreates it

Hosted in JCenter

This project (used by FlexibleAdapter) needs to be moved from JCenter to Maven Central to prevent compilation problems.

Error with subprojects

Thanks for this great tool.

However I found an issue working with subprojects.
The path to the subproject is not determined correctly if a more complex project structure is used.
My project structure is similar to this:

ProjectA
ProjectA\SomeDir\ProjectB

It works correctly with ProjectA but as soon as I apply GrabVer to ProjectB it tries to create the version.properties in directory ProjectA\ProjectB which fails because the directory does of course not exist.

I think a solution could be to use Project's file(Object path) method because it resolves a file path relative to the project directory of the given project.

Greetings
Tak

Why hardcode "Always auto increase build number"? Make it optional!

Thank you for the great plugin, it's most comprehensive and developer friendly!

I am not sure how is it supposed to work, but during development the project is run in debug mode tens/hundreds of times. And on every such run GrabVer is activated and ran.
Resulting in version.properties unnecessarily updated on every single run.
Resulting in developer have to reset/revers version.properties before every commit. It's highly annoying.
AmI doing something wrong, I don't think it's intended to become annoyance for developer to revert or ignore version.properties during every commit operation.
Shouldn't there be an option to not increment build number?

doesn't work

hi

Keeps saying:
GrabVer - No save task detected

MAJOR=1
MINOR=0
PATCH=56
PRE_RELEASE=
incrementOn=
BUILD=3
CODE=3

Error in Execution please help me to solve this

  • What went wrong:
    A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-vector-icons'.
> Could not resolve all dependencies for configuration ':react-native-vector-icons:classpath'.
> Could not resolve com.android.tools.build:gradle:2.3.+.
Required by:
Login_Page:react-native-vector-icons:unspecified
> Could not resolve com.android.tools.build:gradle:2.3.+.
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metadata.xml'.
> Permission denied: connect

Code doesn't increase if run bundleRelease

From the docs:

// - Code is increased if exists a task that contains: "bundle", "grabverRelease", ":module:assembleRelease"

But when I run ./gradlew bundleRelease - it doesn't increase
When I run

./gradlew grabverRelease bundleRelease

it increases but it is not being stored in the verstion.properties

The only way it works when I run

./gradlew grabverRelease bundleRelease

with gradle configuration:

versioning {
    major = 1
    minor = 8
    dependsOn = "bundleRelease"
}

The logic in:

if (task.project.name == project.name &&
((versioning.hasDependingTask() && task.name == versioning.dependsOn) ||
(!versioning.hasDependingTask() && (task.name == "compileJava" || task.name == "assembleDebug" || task.name == "assembleRelease")))) {

seems to be a reason - there are no "bundle" there

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.