mirror of
https://github.com/revanced/smali.git
synced 2025-05-08 10:24:31 +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 '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 {
|
||||
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 {
|
||||
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 {
|
||||
antlr3
|
||||
|
||||
jflex
|
||||
}
|
||||
|
||||
@ -76,3 +77,6 @@ task generateJflexSource {
|
||||
|
||||
compileJava.dependsOn generateAntlrSource, generateJflexSource
|
||||
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