mirror of
https://github.com/revanced/Apktool.git
synced 2025-06-13 05:27:36 +02:00
refactor gradle version system for release, snapshots and non-git snapshots
This commit is contained in:
@ -13,8 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
version = apktoolversion
|
||||
apply plugin: 'fatjar'
|
||||
|
||||
configurations {
|
||||
@ -35,7 +33,7 @@ gradle.taskGraph.whenReady {
|
||||
}
|
||||
|
||||
task proguard(type: JavaExec, dependsOn: fatJar) {
|
||||
def outFile = jar.destinationDir.getPath() + '/' + jar.baseName + '-' + jar.version + '-small' + '.' + jar.extension
|
||||
def outFile = jar.destinationDir.getPath() + '/' + "apktool" + '-' + project.apktool_version + '-small' + '.' + jar.extension
|
||||
inputs.file jar.archivePath
|
||||
outputs.file outFile
|
||||
|
||||
|
@ -16,26 +16,11 @@
|
||||
|
||||
import org.apache.tools.ant.filters.*
|
||||
|
||||
// release
|
||||
if (!('release' in gradle.startParameter.taskNames)) {
|
||||
ant.loadfile(srcFile: "../../.git/refs/heads/master", property: fullrev, failonerror: false);
|
||||
if (ant.properties[fullrev] == null) {
|
||||
gitrev_version = "SNAPSHOT_DEV";
|
||||
println "Building SNAPSHOT (no .git folder found)";
|
||||
} else {
|
||||
gitrev_version = ant.properties[fullrev].substring(0,10);
|
||||
println "Building SNAPSHOT: " + gitrev_version;
|
||||
}
|
||||
} else {
|
||||
gitrev_version = '';
|
||||
println "Building RELEASE: " + apktoolversion;
|
||||
}
|
||||
|
||||
processResources {
|
||||
from('src/main/resources/properties') {
|
||||
include '**/*.properties'
|
||||
into 'properties'
|
||||
filter(ReplaceTokens, tokens: [version: apktoolversion, gitrev: gitrev_version] )
|
||||
filter(ReplaceTokens, tokens: [version: project.apktool_version, gitrev: project.hash] )
|
||||
}
|
||||
from('src/main/resources/') {
|
||||
include '**/*.jar'
|
||||
@ -43,10 +28,12 @@ processResources {
|
||||
|
||||
includeEmptyDirs = false
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile ("junit:junit:4.10") {
|
||||
exclude(module: 'hamcrest-core')
|
||||
}
|
||||
|
||||
compile project(':brut.j.dir'),
|
||||
project(':brut.j.util'),
|
||||
project(':brut.j.common'),
|
||||
|
Reference in New Issue
Block a user