mirror of
https://github.com/revanced/smali.git
synced 2025-05-08 18:34:32 +02:00
Implement versioning in the gradle build
This commit is contained in:
parent
480c79aeea
commit
7d1263a4ff
@ -4,3 +4,6 @@ dependencies {
|
|||||||
compile 'commons-cli:commons-cli:1.2'
|
compile 'commons-cli:commons-cli:1.2'
|
||||||
compile 'com.google.code.findbugs:jsr305:1.3.9'
|
compile 'com.google.code.findbugs:jsr305:1.3.9'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processResources.inputs.properties('version': { -> version})
|
||||||
|
processResources.expand('version': { -> version})
|
1
baksmali/src/main/resources/baksmali.properties
Normal file
1
baksmali/src/main/resources/baksmali.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
application.version=${version}
|
@ -1 +0,0 @@
|
|||||||
application.version=${pom.version}
|
|
40
build.gradle
40
build.gradle
@ -1,7 +1,47 @@
|
|||||||
subprojects {
|
subprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
|
version = "1.3.4"
|
||||||
|
|
||||||
|
// For non-release builds, we want to append the commit and
|
||||||
|
// dirty status to the version
|
||||||
|
gradle.taskGraph.whenReady {
|
||||||
|
if (!it.hasTask(release)) {
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
|
||||||
|
version += '-' + versionSuffix
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: please don't use this. This is strictly for the official releases
|
||||||
|
// that are posted on the googlecode download page.
|
||||||
|
task release {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'org.eclipse.jgit:org.eclipse.jgit:2.0.0.201206130900-r'
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
configurations {
|
configurations {
|
||||||
antlr3
|
antlr3
|
||||||
|
|
||||||
jflex
|
jflex
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,3 +77,6 @@ task generateJflexSource {
|
|||||||
|
|
||||||
compileJava.dependsOn generateAntlrSource, generateJflexSource
|
compileJava.dependsOn generateAntlrSource, generateJflexSource
|
||||||
compileTestJava.dependsOn generateTestAntlrSource
|
compileTestJava.dependsOn generateTestAntlrSource
|
||||||
|
|
||||||
|
processResources.inputs.properties('version': { -> version})
|
||||||
|
processResources.expand('version': { -> version})
|
@ -1 +1 @@
|
|||||||
application.version=${pom.version}
|
application.version=${version}
|
Loading…
x
Reference in New Issue
Block a user