| apply plugin: 'java' |
| apply plugin: 'kotlin' |
| apply plugin: 'clone-artifacts' |
| apply plugin: 'sdk-java-lib' |
| |
| dependencies { |
| compile project(':base:annotations') |
| implementation libs.kotlin_stdlib |
| testCompile 'junit:junit:4.12' |
| testImplementation libs.guava |
| testImplementation project(':base:testutils') |
| } |
| |
| group = 'com.android.tools.build' |
| archivesBaseName = 'builder-model' |
| version = rootProject.ext.buildVersion |
| |
| project.ext.pomName = 'Android Builder Model library' |
| project.ext.pomDesc = 'Model for the Builder library.' |
| |
| project.ext.apiVersion = rootProject.ext.apiVersion ?: 0 |
| |
| // because the model is passed from the IDE to Gradle, no matter |
| // what version of Gradle Plugin is running, we need to keep this |
| // as Java6 bytecode in case Studio 2.2 loads a project running |
| // an older plugin in a JDK6 VM. |
| compileJava { |
| sourceCompatibility = JavaVersion.VERSION_1_6 |
| targetCompatibility = JavaVersion.VERSION_1_6 |
| } |
| |
| compileKotlin { |
| sourceCompatibility = JavaVersion.VERSION_1_6 |
| targetCompatibility = JavaVersion.VERSION_1_6 |
| |
| kotlinOptions { |
| jvmTarget = "1.6" |
| apiVersion = "1.3" |
| languageVersion = "1.3" |
| } |
| } |
| |
| apply from: "$rootDir/buildSrc/base/publish.gradle" |
| apply from: "$rootDir/buildSrc/base/javadoc.gradle" |
| |
| ["Model-Version": version, "Model-Api-Version": apiVersion].each { key, value -> |
| jar.manifest.attributes((key): value) |
| sdkJar.manifest.attributes((key): value) |
| } |
| |
| def generated = project.layout.buildDirectory.dir("generated/resources") |
| |
| sourceSets { |
| main { |
| resources { |
| srcDir generated |
| } |
| } |
| } |
| |
| task writeVersionProperties(type: com.android.tools.internal.VersionPropertiesWriter) { |
| outputFilePath = "com/android/builder/model/version.properties" |
| outputDirectory = generated |
| } |
| |
| tasks.compileJava.dependsOn writeVersionProperties |