Files
AndroidIDE/subprojects/tooling-api-impl/build.gradle
T
2022-12-21 18:36:08 +05:30

91 lines
2.4 KiB
Groovy

/*
* This file is part of AndroidIDE.
*
* AndroidIDE 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.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
}
java {
sourceCompatibility = rootProject.ext.javaSourceVersion
targetCompatibility = rootProject.ext.javaTargetVersion
}
jar {
manifest {
attributes ('Main-Class': 'com.itsaky.androidide.tooling.impl.Main')
}
}
task processSource (type: Sync) {
from sourceSets.main.java
filter (ReplaceTokens, tokens: [AGP_VERSION: project.property ("androidide.tooling.supportedAgpVersion")])
into "$buildDir/src"
}
compileJava {
source = processSource.outputs
}
shadowJar {
archiveBaseName.set ('tooling-api')
archiveClassifier.set ('all')
}
task copyJarToAssets (type: Copy) {
from project.file ("${project.buildDir}/libs/tooling-api-all.jar")
into project.rootProject.file ("app/src/main/assets/data/common/")
}
project.tasks.jar.finalizedBy shadowJar
project.tasks.shadowJar.finalizedBy copyJarToAssets
repositories {
maven {
url 'https://repo.gradle.org/gradle/libs-releases/'
}
}
dependencies {
implementation project (path: ':subprojects:tooling-api')
implementation common.jkotlin
implementation xml.xercesImpl
implementation xml.apis
implementation 'org.gradle:gradle-tooling-api:7.6'
testImplementation project (path: ':subprojects:tooling-api-testing')
testImplementation tests.junit
testImplementation tests.google_truth
runtimeOnly 'org.slf4j:slf4j-api:2.0.6'
}
compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}