代码拉取完成,页面将自动刷新
/*
* Some Gradle tasks we use:
*
* - Build: `./gradlew check`
* -> test reports: ./build/reports/tests/test/index.html
* -> coverage reports: ./build/reports/jacoco/test/html/index.html
* -> javadoc: `./build/docs/javadoc`
*
* - Release: `./gradlew release --info`
*
* - Release:
* -> checking the generated artifacts: `./gradlew publishAllPublicationsToTestRepo` then look into `build/repo`
* -> Releasing: `./gradlew release --info`
*
* In order to perform a release you need to:
* - Add the following properties to ~/.gradle/gradle.properties
* ossrhUsername=<username>
* ossrhPassword=<password>
* - or pass the credentials as command line parameters
* ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -DossrhUsername=<my-username> -DossrhPassword=<my-password>
*
* And for signing the artifacts:
* - Get public key ID `gpg --list-keys --keyid-format SHORT`
* - Export key `gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg`
* - Add the following properties to ~/.gradle/gradle.properties
* signing.keyId=0ABCDEF
* signing.password=password
* signing.secretKeyRingFile=/absolute/path/to/.gnupg/secring.gpg
*/
plugins {
// library
id 'java-library'
id 'jacoco'
// publishing
id 'maven-publish'
id 'signing'
id 'net.researchgate.release' version '2.8.1'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
}
ext.ammoniteScalaVersion = '2.13'
ext.ammoniteVersion = '2.3.8'
ext.assertjVersion = '3.19.0'
ext.junitVersion = '4.13.2'
// JAVA_VERSION used for CI build matrix, may be provided as env variable
def javaVersion = Integer.parseInt(System.getenv('JAVA_VERSION') ?: '8')
repositories {
mavenCentral()
}
// -- --
// -- JAVA BUILD & CODE GEN --
// -- --
dependencies {
testImplementation "junit:junit:$junitVersion"
testImplementation "org.assertj:assertj-core:$assertjVersion"
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
withSourcesJar()
withJavadocJar()
}
sourceSets.main.java.srcDirs += ['src-gen/main/java']
sourceSets.test.java.srcDirs += ['src-gen/test/java']
task generateSources() {
doLast {
delete 'src-gen'
def ammoniteDir = file("generator/bin")
if (!ammoniteDir.exists()) {
ammoniteDir.mkdirs()
}
def ammoniteJar = new File(ammoniteDir, "amm-${ammoniteScalaVersion}-${ammoniteVersion}.jar")
if (!ammoniteJar.exists()) {
def ammoniteReleaseUrl = "https://github.com/lihaoyi/Ammonite/releases/download/${ammoniteVersion}/${ammoniteScalaVersion}-${ammoniteVersion}"
ant.get(src: ammoniteReleaseUrl, dest: ammoniteJar)
}
javaexec {
main = "-jar"
args = [ammoniteJar, "generator/Generator.sc"]
}
}
}
compileJava.dependsOn 'generateSources'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs = [ '-Werror', '-Xlint:all', '-Xlint:-deprecation' ]
}
tasks.named('jacocoTestReport') {
reports {
xml.enabled = true
}
}
tasks.named('check') {
dependsOn jacocoTestReport
dependsOn javadoc
}
tasks.named('jar') {
manifest {
attributes('Automatic-Module-Name': 'io.vavr')
}
}
tasks.register('testSourcesJar', Jar) {
from sourceSets.test.allSource
archiveClassifier = 'test-sources'
}
// -- --
// -- PUBLISHING & RELEASING --
// -- --
// What we want to publish
publishing {
repositories {
maven {
// A test repository which can be used to
// verify what is going to be uploaded by
// running ./gradlew publishAllPublicationsToTestRepo
name = "testRepo"
url = "${buildDir}/repo"
}
}
publications {
maven(MavenPublication) {
from components.java
// vavr also publishes a test sources jar
artifact tasks.named('testSourcesJar')
pom {
name = project.name
description = "Vavr is an object-functional library for Java 8+"
url = 'https://www.vavr.io'
inceptionYear = '2014'
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Daniel Dietrich'
email = 'cafebab3@gmail.com'
organization = 'Vavr'
organizationUrl = 'https://github.com/vavr-io'
}
}
scm {
connection = 'scm:git:https://github.com/vavr-io/vavr.git'
developerConnection = 'scm:git:https://github.com/vavr-io/vavr.git'
url = 'https://github.com/vavr-io/vavr/tree/master'
}
}
}
}
}
// Signing configuration mandatory for Maven Central
signing {
required { !version.endsWith("-SNAPSHOT") }
publishing.publications.configureEach {
sign(it)
}
}
// Configure the publishing repositories for Maven Central
nexusPublishing {
repositories {
sonatype {
username.set(providers.systemProperty("ossrhUsername").forUseAtConfigurationTime())
password.set(providers.systemProperty("ossrhPassword").forUseAtConfigurationTime())
}
}
}
// Configure the "release" plugin
tasks.named('afterReleaseBuild') {
dependsOn "publishToSonatype", "closeAndReleaseSonatypeStagingRepository"
}
release {
buildTasks = ['build']
tagTemplate = '$name-$version'
git {
requireBranch = ''
pushToRemote = 'origin'
pushToCurrentBranch = true
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。