multidexlib2/build.gradle
2019-11-19 07:50:31 -03:00

89 lines
2.1 KiB
Groovy

/*
* multidexlib2 - Copyright 2015-2019 Rodrigo Balerdi
* (GNU General Public License version 3 or later)
*
* multidexlib2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*/
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
def dexlib2Version = '2.3.4'
def multidexlib2VersionSuffix = ''
group = 'com.github.lanchon.dexpatcher'
version = dexlib2Version + multidexlib2VersionSuffix
def mainArtifact = 'multidexlib2'
def artifactName = mainArtifact
sourceCompatibility = '1.7'
def jdk = findProperty('JDK7_HOME') ?: '/usr/lib/jvm/java-7-openjdk-amd64'
def jdk_rt = new File(jdk, 'jre/lib/rt.jar')
if (jdk_rt.exists()) compileJava.options.bootstrapClasspath = files(jdk_rt)
repositories {
jcenter()
}
dependencies {
api 'org.smali:dexlib2:' + dexlib2Version
}
java {
withJavadocJar()
withSourcesJar()
}
def generatedResourcesDir = layout.buildDirectory.get().dir('generated-resources')
task generateResources(type: Sync) {
// Add copyright notice license.
from(rootDir) {
include 'NOTICE.txt'
include 'LICENSE.txt'
}
into generatedResourcesDir
}
sourceSets.main.output.dir builtBy: generateResources, generatedResourcesDir
def sharedManifest = manifest {
attributes(
'Implementation-Title': artifactName,
'Implementation-Version': version
)
}
tasks.withType(Jar).configureEach {
manifest.from sharedManifest
reproducibleFileOrder = true
preserveFileTimestamps = false
duplicatesStrategy = DuplicatesStrategy.FAIL
}
apply from: 'configure-publishing.gradle'
publishing {
publications {
multidexlib2(MavenPublication) {
artifactId = mainArtifact
from components.java
pom {
name = artifactName
configurePom it
}
}
}
}
apply from: 'check-copyright.gradle'
wrapper.distributionType = Wrapper.DistributionType.ALL