Skip to content

Commit

Permalink
Configuração para gerar snapshot e release.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandreant committed Dec 17, 2014
1 parent 9712896 commit 4c5eda8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
42 changes: 22 additions & 20 deletions brut.apktool.smali/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,29 @@ version = '2.0.3'
def jarVersion = version

if (!('release' in gradle.startParameter.taskNames)) {
def versionSuffix
try {
def git = org.eclipse.jgit.api.Git.open(file('../.'))
def head = git.getRepository().getRef("HEAD")
versionSuffix = head.getObjectId().abbreviate(8).name()
// def versionSuffix
// try {
// def git = org.eclipse.jgit.api.Git.open(file('../.'))
// def head = git.getRepository().getRef("HEAD")
// versionSuffix = head.getObjectId().abbreviate(8).name()
//
// if (!git.status().call().clean) {
// versionSuffix += '-dirty'
// }
// } catch (Exception) {
// // In case we can't get the commit for some reason,
// // just use -dev
// versionSuffix = 'dev'
// }
//
// def baseVersion = version
// version = baseVersion + '-' + versionSuffix
//
// // use something like module-1.2.3-dev.jar for the jar name, rather than the full
// // module-1.2.3-001afe02-dirty.jar
// jarVersion = baseVersion + '-dev'

if (!git.status().call().clean) {
versionSuffix += '-dirty'
}
} catch (Exception) {
// In case we can't get the commit for some reason,
// just use -dev
versionSuffix = 'dev'
}

def baseVersion = version
version = baseVersion + '-' + versionSuffix

// use something like module-1.2.3-dev.jar for the jar name, rather than the full
// module-1.2.3-001afe02-dirty.jar
jarVersion = baseVersion + '-dev'
version = jarVersion + "-SNAPSHOT"
}

subprojects {
Expand Down
1 change: 0 additions & 1 deletion brut.apktool/apktool-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.apache.tools.ant.filters.*
apply plugin: "maven"

group = "brut.apktool"
version = "2.0.0-RC2"

processResources {
from('src/main/resources/properties') {
Expand Down
1 change: 0 additions & 1 deletion brut.j.common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

group = "brut.j.common"
version = "2.0.0-RC2"

dependencies {
testCompile depends.junit
Expand Down
1 change: 0 additions & 1 deletion brut.j.dir/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

group = "brut.j.dir"
version = "2.0.0-RC2"

dependencies {
compile project(':brut.j.common'),
Expand Down
1 change: 0 additions & 1 deletion brut.j.util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

group = "brut.j.util"
version = "2.0.0-RC2"

dependencies {
compile project(':brut.j.common'),
Expand Down
24 changes: 13 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ allprojects {
}

if (!('release' in gradle.startParameter.taskNames)) {
def hash = getCheckedOutGitCommitHash();

if (hash == null) {
project.ext.set("hash", "dirty")
project.ext.set("apktool_version", apktoolversion_major + "-dirty")
println "Building SNAPSHOT (no .git folder found)";
} else {
project.ext.set("hash", hash);
project.ext.set("apktool_version", apktoolversion_major + "-" + hash + "-SNAPSHOT");
println "Building SNAPSHOT (" + getCheckedOutBranch() + "): " + hash;
}
// def hash = getCheckedOutGitCommitHash();

// if (hash == null) {
// project.ext.set("hash", "dirty")
// project.ext.set("apktool_version", apktoolversion_major + "-dirty")
// println "Building SNAPSHOT (no .git folder found)";
// } else {
project.ext.set("hash", "SNAPSHOT");
project.ext.set("apktool_version", apktoolversion_major + "-" + apktoolversion_minor + "-SNAPSHOT");
println "Building SNAPSHOT (" + getCheckedOutBranch() + "): " + apktoolversion_major + "-" + apktoolversion_minor + "-SNAPSHOT";
// }
} else {
project.ext.set("hash", "")
project.ext.set("apktool_version", apktoolversion_major + "-" + apktoolversion_minor);
Expand Down Expand Up @@ -84,6 +84,8 @@ subprojects {
apply plugin: 'maven'
apply plugin: 'idea'

version = project.apktool_version

ext {
depends = [
antlr: 'org.antlr:antlr:3.5',
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Oct 23 07:11:01 CDT 2014
#Tue Dec 16 18:19:29 BRST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-all.zip

0 comments on commit 4c5eda8

Please sign in to comment.