2 Star 5 Fork 1

phodal/chapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle.kts 5.03 KB
一键复制 编辑 原始数据 按行查看 历史
phodal 提交于 2022-03-01 08:17 . build: update versions
plugins {
base
val kotlinVersion = "1.6.10"
kotlin("jvm") version kotlinVersion apply false
id("java-library")
id("maven-publish")
publishing
signing
java
id("jacoco-report-aggregation")
id("com.github.kt3k.coveralls") version "2.9.0"
}
jacoco {
toolVersion = "0.8.7"
}
allprojects {
group = "com.phodal.chapi"
version = "0.0.7"
description =
"Chapi is A common language meta information convertor, convert different languages to same meta-data model"
repositories {
mavenCentral()
mavenLocal()
}
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "publishing")
apply(plugin = "jacoco")
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("Chapi")
description.set("Chapi is A common language meta information convertor, convert different languages to same meta-data model")
url.set("https://github.com/modernizing/chapi")
licenses {
license {
name.set("MPL 2.0")
url.set("https://github.com/modernizing/chapi/blob/master/LICENSE")
}
}
developers {
developer {
id.set("Modernizing")
name.set("Modernizing Team")
email.set("h@phodal.com")
}
}
scm {
connection.set("scm:git:git://github.com/modernizing/chapi.git")
developerConnection.set("scm:git:ssh://github.com/modernizing/chapi.git")
url.set("https://github.com/modernizing/chapi/")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = (if (project.findProperty("sonatypeUsername") != null) project.findProperty("sonatypeUsername") else System.getenv("MAVEN_USERNAME")).toString()
password = (if (project.findProperty("sonatypePassword") != null) project.findProperty("sonatypePassword") else System.getenv("MAVEN_PASSWORD")).toString()
}
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/modernizing/chapi")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.test {
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
}
tasks.jacocoTestReport {
reports {
xml.required.set(false)
csv.required.set(false)
html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml"))
}
}
tasks.withType<JacocoReport> {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.map {
fileTree(it).apply {
exclude("chapi/ast/antlr")
}
}))
}
}
}
dependencies {
jacocoAggregation(project(":chapi-domain"))
jacocoAggregation(project(":chapi-application"))
jacocoAggregation(project(":chapi-ast-java"))
jacocoAggregation(project(":chapi-ast-typescript"))
jacocoAggregation(project(":chapi-ast-go"))
jacocoAggregation(project(":chapi-ast-python"))
jacocoAggregation(project(":chapi-ast-c"))
jacocoAggregation(project(":chapi-ast-csharp"))
jacocoAggregation(project(":chapi-ast-kotlin"))
jacocoAggregation(project(":chapi-ast-scala"))
jacocoAggregation(project(":chapi-ast-cpp"))
}
reporting {
reports {
val jacocoRootReport by creating(JacocoCoverageReport::class) {
testType.set(TestSuiteType.UNIT_TEST)
}
}
}
tasks.check {
dependsOn(tasks.named<JacocoReport>("jacocoRootReport"))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Kotlin
1
https://gitee.com/phodal/chapi.git
git@gitee.com:phodal/chapi.git
phodal
chapi
chapi
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385