Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
232 changes: 108 additions & 124 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,144 +1,128 @@
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'net.ltgt.gradle:gradle-apt-plugin:0.21'
}
}

rootProject.version = '9.9.0'
group = 'com.spaceshift'

allprojects {

repositories {
mavenCentral()
jcenter()
}
rootProject.version = "9.10.0"
group = 'javasabr'

apply plugin: 'java'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

ext {
projectreactorVersion = '3.2.9.RELEASE'
sl4jVersion = '1.7.26'
javaxMailVersion = "1.5.0-b01"
testcontainersVersion = '1.11.1'
lombokVersion = '1.18.6'
junitJupiterVersion = "5.4.2"
jetbrainsAnnotation = '17.0.0'
bintrayVersion = version
}
subprojects {

javadoc {
failOnError = false
}
repositories {
mavenCentral()
}

test {
useJUnitPlatform()
}
apply plugin: "java-library"
apply plugin: "java-test-fixtures"
apply plugin: 'maven-publish'

dependencies {
compileOnly "org.jetbrains:annotations:$jetbrainsAnnotation"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"

testCompile "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
testCompileOnly "org.projectlombok:lombok:$lombokVersion"
testCompileOnly "org.jetbrains:annotations:$jetbrainsAnnotation"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}

/*compileJava {
inputs.property("moduleName", jar.baseName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}*/

task sourcesJar(type: Jar, dependsOn: classes) {
afterEvaluate {
getArchiveClassifier().set("sources")
getArchiveBaseName().set(jar.getArchiveBaseName())
from sourceSets.main.allSource
}

javadoc {
failOnError = false
}

test {
useJUnitPlatform()
failOnNoDiscoveredTests = false
}

dependencies {
compileOnly libs.jetbrains.annotations
compileOnly libs.jspecify
compileOnly libs.lombok
annotationProcessor libs.lombok

testImplementation libs.junit.api
testCompileOnly libs.lombok
testCompileOnly libs.jetbrains.annotations
testCompileOnly libs.jspecify
testRuntimeOnly libs.junit.engine
testRuntimeOnly libs.junit.platform.launcher
testAnnotationProcessor libs.lombok
}

/*compileJava {
inputs.property("moduleName", jar.baseName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}*/

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}

tasks.withType(Javadoc).configureEach {
options.encoding = "UTF-8"
}

tasks.register("sourcesJar", Jar) {
dependsOn "classes"
group "build"
archiveClassifier = "sources"
archiveBaseName = jar.archiveBaseName
from sourceSets.main.allSource
}

tasks.register("javadocJar", Jar) {
dependsOn "javadoc"
group "build"
archiveClassifier = "javadoc"
archiveBaseName = jar.archiveBaseName
from sourceSets.main.allSource
}

publishing {
repositories {
maven {
name = "GitlabPackages"
url = uri("https://gitlab.com/api/v4/projects/37512056/packages/maven")
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = project.findProperty("gitlab.token") ?: System.getenv("GITLAB_TOKEN")
}
}

task javadocJar(type: Jar, dependsOn: javadoc) {
afterEvaluate {
getArchiveClassifier().set("javadoc")
getArchiveBaseName().set(jar.getArchiveBaseName())
from sourceSets.main.allSource
authentication {
header(HttpHeaderAuthentication)
}
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
version = rootProject.version
afterEvaluate {
artifactId = jar.baseName
groupId = rootProject.group
}
}
}
}

bintray {
publications {
mavenJava(MavenPublication) {
from components.java
version = rootProject.version
afterEvaluate {
user = project.hasProperty("bintrayUser") ? project.property("bintrayUser") : ""
key = project.hasProperty("bintrayKey") ? project.property("bintrayKey") : ""
publications = ['mavenJava']
pkg {
repo = 'maven'
name = 'com.spaceshift.' + jar.baseName
licenses = ['Apache-2.0']
websiteUrl = 'https://github.com/JavaSaBr/Rlib'
vcsUrl = 'https://github.com/JavaSaBr/RLib.git'
issueTrackerUrl = 'https://github.com/JavaSaBr/RLib/issues'
githubRepo = 'JavaSaBr/RLib'
githubReleaseNotesFile = 'README.md'
version {
name = rootProject.version
desc = rootProject.version
released = new Date()
}
}
artifactId = jar.archiveBaseName.get()
groupId = rootProject.group
}
artifact sourcesJar
artifact javadocJar
}
}
}

configurations {
testArtifacts.extendsFrom testRuntime
}
configurations {
testArtifacts.extendsFrom testRuntime
}

task testJar(type: Jar) {
getArchiveClassifier().set("test")
from sourceSets.test.output
}
tasks.register('testJar', Jar) {
archiveClassifier = "test"
from sourceSets.test.output
}

artifacts {
testArtifacts testJar
}
artifacts {
testArtifacts testJar
}

tasks.withType(Test) {
maxParallelForks = Runtime.runtime.availableProcessors()
}
tasks.withType(Test).configureEach {
maxParallelForks = Runtime.runtime.availableProcessors()
}
}

wrapper {
gradleVersion = '6.0'
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '9.0.0'
distributionType = Wrapper.DistributionType.ALL
}
40 changes: 40 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[versions]
# https://mvnrepository.com/artifact/org.slf4j/slf4j-api
slf4j = "2.0.17"
# https://mvnrepository.com/artifact/io.projectreactor/reactor-core
project-reactor = "3.7.8"
# https://mvnrepository.com/artifact/jakarta.mail/jakarta.mail-api
jakarta-mail = "2.1.3"
# https://mvnrepository.com/artifact/org.eclipse.angus/angus-mail
angus-mail = "2.0.4"
# https://mvnrepository.com/artifact/org.testcontainers/testcontainers
testcontainers = "1.21.3"
# https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
junit-jupiter = "5.13.4"
# https://mvnrepository.com/artifact/org.jetbrains/annotations
jetbrains-annotations = "26.0.2"
# https://mvnrepository.com/artifact/org.projectlombok/lombok
lombok = "1.18.38"
# https://mvnrepository.com/artifact/org.jspecify/jspecify
jspecify = "1.0.0"
# https://mvnrepository.com/artifact/org.junit.platform/junit-platform-launcher
junit-platform-launcher = "1.13.4"

[libraries]
project-reactor-core = { module = "io.projectreactor:reactor-core", version.ref = "project-reactor" }
jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" }
jspecify = { module = "org.jspecify:jspecify", version.ref = "jspecify" }
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" }
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform-launcher" }
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }
slf4j-ext = { module = "org.slf4j:slf4j-ext", version.ref = "slf4j" }
jakarta-mail-api = { module = "jakarta.mail:jakarta.mail-api", version.ref = "jakarta-mail" }
angus-mail = { module = "org.eclipse.angus:angus-mail", version.ref = "angus-mail" }
testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" }

[bundles]
junit = ["junit-engine", "junit-api"]
mail = ["jakarta-mail-api", "angus-mail"]
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading