diff --git a/devkit-core/build.gradle.kts b/devkit-core/build.gradle.kts index 2445a99..ddb0713 100644 --- a/devkit-core/build.gradle.kts +++ b/devkit-core/build.gradle.kts @@ -17,15 +17,14 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project val licenseUrl: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion java { sourceCompatibility = JavaVersion.VERSION_17 @@ -41,9 +40,9 @@ tasks.test { publishing { publications { create("devkitCore") { - groupId = buildGroupId + groupId = group.toString() artifactId = "devkit-core" - version = buildVersion + version = artefactVersion pom { name = "DevKit - Core" diff --git a/devkit-utils/build.gradle.kts b/devkit-utils/build.gradle.kts index ec1ff36..a420987 100644 --- a/devkit-utils/build.gradle.kts +++ b/devkit-utils/build.gradle.kts @@ -17,15 +17,14 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project val licenseUrl: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-core")) @@ -45,9 +44,9 @@ tasks.test { publishing { publications { create("devkitUtils") { - groupId = buildGroupId + groupId = group.toString() artifactId = "devkit-utils" - version = buildVersion + version = artefactVersion pom { name = "DevKit - Utils" diff --git a/gradle.properties b/gradle.properties index 435e1d8..6f81f6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,8 +24,7 @@ slf4jVersion=2.0.16 springVersion=6.1.13 springBootVersion=3.3.4 -buildGroupId=com.onixbyte -buildVersion=1.6.5 +artefactVersion=1.6.5 projectUrl=https://onixbyte.com/JDevKit projectGithubUrl=https://github.com/OnixByte/JDevKit licenseName=The Apache License, Version 2.0 diff --git a/guid/build.gradle.kts b/guid/build.gradle.kts index 12c72c3..c92aa23 100644 --- a/guid/build.gradle.kts +++ b/guid/build.gradle.kts @@ -17,15 +17,14 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project val licenseUrl: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-core")) @@ -45,9 +44,9 @@ tasks.test { publishing { publications { create("guid") { - groupId = buildGroupId + groupId = group.toString() artifactId = "guid" - version = buildVersion + version = artefactVersion pom { name = "DevKit - GUID" diff --git a/key-pair-loader/build.gradle.kts b/key-pair-loader/build.gradle.kts index 17c4fd3..9c53390 100644 --- a/key-pair-loader/build.gradle.kts +++ b/key-pair-loader/build.gradle.kts @@ -17,15 +17,14 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project val licenseUrl: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-core")) @@ -45,9 +44,9 @@ tasks.test { publishing { publications { create("keyPairLoader") { - groupId = buildGroupId + groupId = group.toString() artifactId = "key-pair-loader" - version = buildVersion + version = artefactVersion pom { name = "Key Pair Loader" diff --git a/map-util-unsafe/build.gradle.kts b/map-util-unsafe/build.gradle.kts index 3376b22..c3433c9 100644 --- a/map-util-unsafe/build.gradle.kts +++ b/map-util-unsafe/build.gradle.kts @@ -17,15 +17,14 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project val licenseUrl: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-core")) @@ -45,9 +44,9 @@ tasks.test { publishing { publications { create("mapUtilUnsafe") { - groupId = buildGroupId + groupId = group.toString() artifactId = "map-util-unsafe" - version = buildVersion + version = artefactVersion pom { name = "Unsafe Map Util" diff --git a/num4j/build.gradle.kts b/num4j/build.gradle.kts index d95c6ac..977c683 100644 --- a/num4j/build.gradle.kts +++ b/num4j/build.gradle.kts @@ -1,19 +1,98 @@ -plugins { - id("java") -} +/* + * Copyright (C) 2024-2024 OnixByte. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import java.net.URI + +val artefactVersion: String by project +val projectUrl: String by project +val projectGithubUrl: String by project +val licenseName: String by project +val licenseUrl: String by project group = "com.onixbyte" -version = "unspecified" - -repositories { - mavenCentral() -} +version = artefactVersion dependencies { - testImplementation(platform("org.junit:junit-bom:5.10.0")) - testImplementation("org.junit.jupiter:junit-jupiter") + implementation(project(":devkit-core")) +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + withSourcesJar() + withJavadocJar() } tasks.test { useJUnitPlatform() +} + +publishing { + publications { + create("num4j") { + groupId = group.toString() + artifactId = "num4j" + version = artefactVersion + + pom { + name = "Num4j" + description = + "This module is an easy-to-use util for mathematical calculations in Java." + url = projectUrl + + licenses { + license { + name = licenseName + url = licenseUrl + } + } + + scm { + connection = "scm:git:git://github.com:OnixByte/JDevKit.git" + developerConnection = "scm:git:git://github.com:OnixByte/JDevKit.git" + url = projectGithubUrl + } + + developers { + developer { + id = "zihluwang" + name = "Zihlu Wang" + email = "really@zihlu.wang" + timezone = "Asia/Hong_Kong" + } + } + } + + from(components["java"]) + + signing { + sign(publishing.publications["num4j"]) + } + } + + repositories { + maven { + name = "sonatypeNexus" + url = URI(providers.gradleProperty("repo.maven-central.host").get()) + credentials { + username = providers.gradleProperty("repo.maven-central.username").get() + password = providers.gradleProperty("repo.maven-central.password").get() + } + } + } + } } \ No newline at end of file diff --git a/property-guard-spring-boot-starter/build.gradle.kts b/property-guard-spring-boot-starter/build.gradle.kts index 4cf4b06..33214a5 100644 --- a/property-guard-spring-boot-starter/build.gradle.kts +++ b/property-guard-spring-boot-starter/build.gradle.kts @@ -17,8 +17,7 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project @@ -26,8 +25,8 @@ val licenseUrl: String by project val springBootVersion: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-utils")) @@ -51,9 +50,9 @@ tasks.test { publishing { publications { create("propertyGuardSpringBootStarter") { - groupId = buildGroupId + groupId = group.toString() artifactId = "property-guard-spring-boot-starter" - version = buildVersion + version = artefactVersion pom { name = "Property Guard Spring Boot Starter" diff --git a/simple-jwt-authzero/build.gradle.kts b/simple-jwt-authzero/build.gradle.kts index 55a62ea..20686b2 100644 --- a/simple-jwt-authzero/build.gradle.kts +++ b/simple-jwt-authzero/build.gradle.kts @@ -17,8 +17,7 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project @@ -27,8 +26,8 @@ val licenseUrl: String by project val jacksonVersion: String by project val javaJwtVersion: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-utils")) @@ -53,9 +52,9 @@ tasks.test { publishing { publications { create("simpleJwtAuthzero") { - groupId = buildGroupId + groupId = group.toString() artifactId = "simple-jwt-authzero" - version = buildVersion + version = artefactVersion pom { name = "Simple JWT :: Auth0" diff --git a/simple-jwt-facade/build.gradle.kts b/simple-jwt-facade/build.gradle.kts index 319bde4..772d72e 100644 --- a/simple-jwt-facade/build.gradle.kts +++ b/simple-jwt-facade/build.gradle.kts @@ -17,15 +17,14 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project val licenseUrl: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":devkit-core")) @@ -47,9 +46,9 @@ tasks.test { publishing { publications { create("simpleJwtFacade") { - groupId = buildGroupId + groupId = group.toString() artifactId = "simple-jwt-facade" - version = buildVersion + version = artefactVersion pom { name = "Simple JWT :: Facade" diff --git a/simple-jwt-spring-boot-starter/build.gradle.kts b/simple-jwt-spring-boot-starter/build.gradle.kts index 3464e97..02fa091 100644 --- a/simple-jwt-spring-boot-starter/build.gradle.kts +++ b/simple-jwt-spring-boot-starter/build.gradle.kts @@ -17,8 +17,7 @@ import java.net.URI -val buildGroupId: String by project -val buildVersion: String by project +val artefactVersion: String by project val projectUrl: String by project val projectGithubUrl: String by project val licenseName: String by project @@ -28,8 +27,8 @@ val javaJwtVersion: String by project val jacksonVersion: String by project val springBootVersion: String by project -group = buildGroupId -version = buildVersion +group = "com.onixbyte" +version = artefactVersion dependencies { implementation(project(":guid")) @@ -58,9 +57,9 @@ tasks.test { publishing { publications { create("simpleJwtSpringBootStarter") { - groupId = buildGroupId + groupId = group.toString() artifactId = "simple-jwt-spring-boot-starter" - version = buildVersion + version = artefactVersion pom { name = "Simple JWT :: Spring Boot Starter"