1 Star 0 Fork 0

Github-android-mirror/accompanist

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
build.gradle 2.69 KB
Copy Edit Raw Blame History
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'java-library'
id 'kotlin'
id 'org.jetbrains.dokka'
id 'com.android.lint'
}
kotlin {
explicitApi()
}
lintOptions {
htmlReport true
htmlOutput file("lint-report.html")
textReport true
absolutePaths false
ignoreTestSources true
}
affectedTestConfiguration {
jvmTestTask = "test"
}
/**
* Creates a configuration for users to use that will be used bundle these dependency
* jars inside of this lint check's jar. This is required because lintPublish does
* not currently support dependencies, so instead we need to bundle any dependencies with the
* lint jar manually. (b/182319899)
*/
def bundle = configurations.create("bundleInside")
// bundleInside dependencies should be included as compileOnly and testImplementation as well
configurations.getByName("compileOnly").setExtendsFrom([bundle])
configurations.getByName("testImplementation").setExtendsFrom([bundle])
tasks.named("jar").configure { task ->
def jarTask = task as Jar
jarTask.dependsOn(bundle)
jarTask.from({
bundle
// The stdlib is already bundled with lint, so no need to include it manually
// in the lint.jar if any dependencies here depend on it
.filter { !it.name.contains("kotlin-stdlib") }
.collect { file ->
if (file.isDirectory()) {
file
} else {
zipTree(file)
}
}
})
}
dependencies {
// Bundle metadataJvm inside the Jar
bundleInside libs.kotlin.metadataJvm
compileOnly libs.android.tools.lint.api
compileOnly libs.kotlin.reflect
compileOnly libs.kotlin.stdlibJdk8 // Needed, cannot use `stdlib`
testImplementation libs.junit
testImplementation libs.kotlin.reflect
testImplementation libs.kotlin.stdlibJdk8 // Needed, cannot use `stdlib`
testImplementation libs.android.tools.lint.lint
testImplementation libs.android.tools.lint.tests
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/github-android-mirror/accompanist.git
git@gitee.com:github-android-mirror/accompanist.git
github-android-mirror
accompanist
accompanist
main

Search