加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.10 KB
一键复制 编辑 原始数据 按行查看 历史
suxi 提交于 2021-06-30 13:50 . fix license to MIT license
/*
* This file was generated by the Gradle 'init' task.
*/
plugins {
id 'java'
id 'maven'
id 'jacoco'
id 'signing'
id 'maven-publish'
id 'net.researchgate.release' version '2.8.1'
}
repositories {
mavenLocal()
maven {
url = uri('https://maven.aliyun.com/repository/central')
}
maven {
url = uri('https://maven.aliyun.com/repository/spring')
}
maven {
url = uri('https://maven.aliyun.com/repository/jcenter')
}
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
testImplementation 'junit:junit:4.12'
}
group = group
version = version
description = 'rsql'
ext {
release = !version.endsWith('SNAPSHOT')
println('release version: ' + release)
}
def ossrhUsername = System.getenv('SONATYPE_NEXUS_USERNAME')
def ossrhPassword = System.getenv('SONATYPE_NEXUS_PASSWORD')
def manifestAttr = {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Created-By": "Gradle Archiver 6.7.1",
"Build-Jdk-Spec": "1.8",
)
}
jar {
manifest manifestAttr
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
manifest manifestAttr
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
manifest manifestAttr
}
artifacts {
archives javadocJar, sourcesJar
}
if (release) {
signing {
sign configurations.archives
}
}
def signInit() {
if (release) {
Properties properties = new Properties()
properties.load(new File('sign.properties').newDataInputStream())
print('key id: ' + properties.get('signing.keyId'))
ext.'signing.keyId' = properties.get('signing.keyId');
ext.'signing.password' = properties.get('signing.password');
ext.'signing.secretKeyRingFile' = properties.get('signing.secretKeyRingFile');
}
}
uploadArchives {
repositories {
mavenDeployer {
if (release) {
signInit()
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
} else {
println('skip upload archives')
return
}
println('upload archives')
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
version version
name 'rsql'
packaging 'jar'
description 'rsql parser'
url 'https://github.com/suxil/rsql'
scm {
connection 'scm:git:git://github.com/suxil/rsql.git'
developerConnection 'scm:git:ssh://git@github.com/suxil/rsql.git'
url 'https://github.com/suxil/rsql/'
}
licenses {
license {
name 'MIT License'
url 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id 'suxil'
name 'suxil'
email 'lu_it_work@163.com'
}
}
}
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
allprojects {
group = group
java.sourceCompatibility = JavaVersion.VERSION_1_8
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include('**/build/jacoco/*.exec')
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination file('${buildDir}/reports/jacoco/report.xml')
html.enabled false
csv.enabled false
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化