1- plugins {
2- id(" java" )
3- }
1+ /*
2+ * Copyright (C) 2024-2024 OnixByte.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ *
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ import java.net.URI
19+
20+ val artefactVersion: String by project
21+ val projectUrl: String by project
22+ val projectGithubUrl: String by project
23+ val licenseName: String by project
24+ val licenseUrl: String by project
425
526group = " com.onixbyte"
6- version = " unspecified "
27+ version = artefactVersion
728
8- repositories {
9- mavenCentral( )
29+ dependencies {
30+ implementation(project( " :devkit-core " ) )
1031}
1132
12- dependencies {
13- testImplementation(platform(" org.junit:junit-bom:5.10.0" ))
14- testImplementation(" org.junit.jupiter:junit-jupiter" )
33+ java {
34+ sourceCompatibility = JavaVersion .VERSION_17
35+ targetCompatibility = JavaVersion .VERSION_17
36+ withSourcesJar()
37+ withJavadocJar()
1538}
1639
1740tasks.test {
1841 useJUnitPlatform()
42+ }
43+
44+ publishing {
45+ publications {
46+ create<MavenPublication >(" num4j" ) {
47+ groupId = group.toString()
48+ artifactId = " num4j"
49+ version = artefactVersion
50+
51+ pom {
52+ name = " Num4j"
53+ description =
54+ " This module is an easy-to-use util for mathematical calculations in Java."
55+ url = projectUrl
56+
57+ licenses {
58+ license {
59+ name = licenseName
60+ url = licenseUrl
61+ }
62+ }
63+
64+ scm {
65+ connection = " scm:git:git://github.com:OnixByte/JDevKit.git"
66+ developerConnection = " scm:git:git://github.com:OnixByte/JDevKit.git"
67+ url = projectGithubUrl
68+ }
69+
70+ developers {
71+ developer {
72+ id = " zihluwang"
73+ name = " Zihlu Wang"
74+ email = " really@zihlu.wang"
75+ timezone = " Asia/Hong_Kong"
76+ }
77+ }
78+ }
79+
80+ from(components[" java" ])
81+
82+ signing {
83+ sign(publishing.publications[" num4j" ])
84+ }
85+ }
86+
87+ repositories {
88+ maven {
89+ name = " sonatypeNexus"
90+ url = URI (providers.gradleProperty(" repo.maven-central.host" ).get())
91+ credentials {
92+ username = providers.gradleProperty(" repo.maven-central.username" ).get()
93+ password = providers.gradleProperty(" repo.maven-central.password" ).get()
94+ }
95+ }
96+ }
97+ }
1998}
0 commit comments