Upgrade to gradle 7.1.1
parent
c089124cca
commit
31b28ae965
340
build.gradle
340
build.gradle
|
@ -1,170 +1,170 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
id 'signing'
|
id 'signing'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'jacoco'
|
id 'jacoco'
|
||||||
id "com.github.hierynomus.license" version "0.16.1"
|
id "com.github.hierynomus.license" version "0.16.1"
|
||||||
id "org.sonarqube" version "3.3"
|
id "org.sonarqube" version "3.3"
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||||
id 'io.codearte.nexus-staging' version '0.30.0'
|
id 'io.codearte.nexus-staging' version '0.30.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven {
|
maven {
|
||||||
url 'http://4thline.org/m2'
|
url 'http://4thline.org/m2'
|
||||||
allowInsecureProtocol true
|
allowInsecureProtocol true
|
||||||
}
|
}
|
||||||
flatDir { dirs 'lib' }
|
flatDir { dirs 'lib' }
|
||||||
}
|
}
|
||||||
|
|
||||||
version = '2.2.2'
|
version = '2.2.2'
|
||||||
group 'com.github.kaklakariada'
|
group 'com.github.kaklakariada'
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion = JavaLanguageVersion.of(11)
|
languageVersion = JavaLanguageVersion.of(11)
|
||||||
}
|
}
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
options.addBooleanOption('html5', true)
|
options.addBooleanOption('html5', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.compilerArgs << '-Xlint:all'
|
options.compilerArgs << '-Xlint:all'
|
||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
if (logger.infoEnabled) {
|
if (logger.infoEnabled) {
|
||||||
testLogging.showStandardStreams = true
|
testLogging.showStandardStreams = true
|
||||||
}
|
}
|
||||||
jvmArgs '-XX:+HeapDumpOnOutOfMemoryError', '-enableassertions'
|
jvmArgs '-XX:+HeapDumpOnOutOfMemoryError', '-enableassertions'
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
rename(/(\w+)_en.properties/, '$1.properties')
|
rename(/(\w+)_en.properties/, '$1.properties')
|
||||||
rename(/(\w+)_zh_CN.properties/, '$1_zh.properties')
|
rename(/(\w+)_zh_CN.properties/, '$1_zh.properties')
|
||||||
filter { line -> line.replaceAll(/@VERSION_NUMBER@/, project.version) }
|
filter { line -> line.replaceAll(/@VERSION_NUMBER@/, project.version) }
|
||||||
}
|
}
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveBaseName = 'portmapper'
|
archiveBaseName = 'portmapper'
|
||||||
archiveVersion = null
|
archiveVersion = null
|
||||||
}
|
}
|
||||||
|
|
||||||
def mainClass = 'org.chris.portmapper.PortMapperStarter'
|
def mainClass = 'org.chris.portmapper.PortMapperStarter'
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Main-Class': mainClass
|
attributes 'Main-Class': mainClass
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks["build"].dependsOn(shadowJar)
|
tasks["build"].dependsOn(shadowJar)
|
||||||
|
|
||||||
task run(type: JavaExec, dependsOn: shadowJar) {
|
task run(type: JavaExec, dependsOn: shadowJar) {
|
||||||
classpath = shadowJar.outputs.files
|
classpath = shadowJar.outputs.files
|
||||||
main = mainClass
|
mainClass = mainClass
|
||||||
workingDir = rootProject.projectDir
|
workingDir = rootProject.projectDir
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives shadowJar
|
archives shadowJar
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'args4j:args4j:2.33'
|
implementation 'args4j:args4j:2.33'
|
||||||
implementation 'org.slf4j:slf4j-api:1.7.31'
|
implementation 'org.slf4j:slf4j-api:1.7.31'
|
||||||
implementation 'org.slf4j:jul-to-slf4j:1.7.31'
|
implementation 'org.slf4j:jul-to-slf4j:1.7.31'
|
||||||
implementation 'ch.qos.logback:logback-classic:1.2.3'
|
implementation 'ch.qos.logback:logback-classic:1.2.3'
|
||||||
implementation 'com.miglayout:miglayout-swing:5.2'
|
implementation 'com.miglayout:miglayout-swing:5.2'
|
||||||
implementation 'org.jdesktop.bsaf:bsaf:1.9.2'
|
implementation 'org.jdesktop.bsaf:bsaf:1.9.2'
|
||||||
implementation ':sbbi-upnplib:1.0.4'
|
implementation ':sbbi-upnplib:1.0.4'
|
||||||
implementation 'org.fourthline.cling:cling-support:2.1.2'
|
implementation 'org.fourthline.cling:cling-support:2.1.2'
|
||||||
implementation 'org.bitlet:weupnp:0.1.4'
|
implementation 'org.bitlet:weupnp:0.1.4'
|
||||||
|
|
||||||
runtimeOnly 'commons-jxpath:commons-jxpath:1.1' // sbbi
|
runtimeOnly 'commons-jxpath:commons-jxpath:1.1' // sbbi
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
testImplementation 'org.mockito:mockito-core:3.11.2'
|
testImplementation 'org.mockito:mockito-core:3.11.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
license {
|
license {
|
||||||
header = file('gradle/license-header.txt')
|
header = file('gradle/license-header.txt')
|
||||||
}
|
}
|
||||||
|
|
||||||
jacocoTestReport {
|
jacocoTestReport {
|
||||||
dependsOn test
|
dependsOn test
|
||||||
reports {
|
reports {
|
||||||
xml.enabled true
|
xml.required = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks["sonarqube"].dependsOn(tasks["jacocoTestReport"])
|
tasks["sonarqube"].dependsOn(tasks["jacocoTestReport"])
|
||||||
|
|
||||||
def getOptionalProperty(String name) {
|
def getOptionalProperty(String name) {
|
||||||
if(project.hasProperty(name)) {
|
if(project.hasProperty(name)) {
|
||||||
return project.property(name)
|
return project.property(name)
|
||||||
}
|
}
|
||||||
logger.info("Project property '${name}' not available. Please it to ~/.gradle/gradle.properties")
|
logger.info("Project property '${name}' not available. Please it to ~/.gradle/gradle.properties")
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
from components.java
|
from components.java
|
||||||
pom {
|
pom {
|
||||||
name = 'UPnP Portmapper'
|
name = 'UPnP Portmapper'
|
||||||
description = 'A tool for managing port forwardings via UPnP'
|
description = 'A tool for managing port forwardings via UPnP'
|
||||||
url = 'https://github.com/kaklakariada/portmapper'
|
url = 'https://github.com/kaklakariada/portmapper'
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name = 'GNU General Public License, Version 3.0'
|
name = 'GNU General Public License, Version 3.0'
|
||||||
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
|
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
developers {
|
developers {
|
||||||
developer {
|
developer {
|
||||||
id = 'kaklakariada'
|
id = 'kaklakariada'
|
||||||
name = 'Christoph'
|
name = 'Christoph'
|
||||||
email = 'kaklakariada@chp1.net'
|
email = 'kaklakariada@chp1.net'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scm {
|
scm {
|
||||||
connection = 'scm:git:https://github.com/kaklakariada/portmapper.git'
|
connection = 'scm:git:https://github.com/kaklakariada/portmapper.git'
|
||||||
developerConnection = 'scm:git:https://github.com/kaklakariada/portmapper.git'
|
developerConnection = 'scm:git:https://github.com/kaklakariada/portmapper.git'
|
||||||
url = 'https://github.com/kaklakariada/portmapper'
|
url = 'https://github.com/kaklakariada/portmapper'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
|
||||||
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
|
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
allowInsecureProtocol = false
|
allowInsecureProtocol = false
|
||||||
credentials(PasswordCredentials) {
|
credentials(PasswordCredentials) {
|
||||||
username = getOptionalProperty("ossrhUsername")
|
username = getOptionalProperty("ossrhUsername")
|
||||||
password = getOptionalProperty("ossrhPassword")
|
password = getOptionalProperty("ossrhPassword")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
signing {
|
signing {
|
||||||
sign publishing.publications.mavenJava
|
sign publishing.publications.mavenJava
|
||||||
}
|
}
|
||||||
|
|
||||||
nexusStaging {
|
nexusStaging {
|
||||||
packageGroup = project.group
|
packageGroup = project.group
|
||||||
username = getOptionalProperty("ossrhUsername")
|
username = getOptionalProperty("ossrhUsername")
|
||||||
password = getOptionalProperty("ossrhPassword")
|
password = getOptionalProperty("ossrhPassword")
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
Loading…
Reference in New Issue