Skip to content

Commit 597111c

Browse files
committed
Gradle: Convert to Kotlin DSL
1 parent b3a63b0 commit 597111c

4 files changed

Lines changed: 116 additions & 103 deletions

File tree

build.gradle

Lines changed: 0 additions & 101 deletions
This file was deleted.

build.gradle.kts

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
plugins {
2+
id("com.google.cloud.artifactregistry.gradle-plugin") version "2.2.5"
3+
id("java")
4+
id("maven-publish")
5+
}
6+
7+
val javaVersion: String by project
8+
val asmVersion: String by project
9+
val bombeVersion: String by project
10+
11+
java {
12+
sourceCompatibility = JavaVersion.toVersion(javaVersion)
13+
targetCompatibility = JavaVersion.toVersion(javaVersion)
14+
}
15+
16+
group = "org.cadixdev"
17+
project.setProperty("archivesBaseName", project.name.toLowerCase())
18+
version = "0.3.0-SNAPSHOT"
19+
20+
repositories {
21+
mavenCentral()
22+
maven {
23+
url = uri("artifactregistry://us-maven.pkg.dev/mw-lunarclient-maven-repo/virtual")
24+
}
25+
}
26+
27+
dependencies {
28+
implementation("org.ow2.asm:asm-commons:$asmVersion")
29+
implementation("org.cadixdev:bombe:$bombeVersion")
30+
implementation("org.cadixdev:bombe-jar:$bombeVersion")
31+
}
32+
33+
tasks.processResources {
34+
from("LICENSE.txt")
35+
}
36+
37+
tasks.register<Jar>("javadocJar") {
38+
dependsOn("javadoc")
39+
from(tasks.javadoc.get().destinationDir)
40+
archiveClassifier.set("javadoc")
41+
}
42+
43+
tasks.register<Jar>("sourcesJar") {
44+
dependsOn("classes")
45+
from(sourceSets.main.get().allSource)
46+
archiveClassifier.set("sources")
47+
}
48+
49+
tasks.jar {
50+
manifest {
51+
attributes("Automatic-Module-Name" to "${project.group}.atlas")
52+
}
53+
}
54+
55+
artifacts {
56+
archives(tasks.named("javadocJar"))
57+
archives(tasks.named("sourcesJar"))
58+
}
59+
60+
publishing {
61+
publications {
62+
create<MavenPublication>("maven") {
63+
artifactId = project.property("archivesBaseName").toString()
64+
from(components["java"])
65+
66+
artifact(tasks["javadocJar"])
67+
artifact(tasks["sourcesJar"])
68+
69+
pom {
70+
name.set(project.name)
71+
description.set(project.description)
72+
packaging = "jar"
73+
url.set(project.property("url").toString())
74+
inceptionYear.set(project.property("inceptionYear").toString())
75+
76+
scm {
77+
url.set("https://github.com/CadixDev/Atlas")
78+
connection.set("scm:git:https://github.com/CadixDev/Atlas.git")
79+
developerConnection.set("scm:git:git@github.com:CadixDev/Atlas.git")
80+
}
81+
82+
issueManagement {
83+
system.set("GitHub")
84+
url.set("https://github.com/CadixDev/Atlas/issues")
85+
}
86+
87+
licenses {
88+
license {
89+
name.set("Mozilla Public License 2.0")
90+
url.set("https://opensource.org/licenses/MPL-2.0")
91+
distribution.set("repo")
92+
}
93+
}
94+
95+
developers {
96+
developer {
97+
id.set("jamierocks")
98+
name.set("Jamie Mansfield")
99+
email.set("jmansfield@cadixdev.org")
100+
url.set("https://www.jamiemansfield.me/")
101+
timezone.set("Europe/London")
102+
}
103+
}
104+
}
105+
}
106+
}
107+
108+
repositories {
109+
maven {
110+
name = "artifactRegistry"
111+
url = uri("artifactregistry://us-maven.pkg.dev/mw-lunarclient-maven-repo/public")
112+
}
113+
}
114+
}

settings.gradle

Lines changed: 0 additions & 2 deletions
This file was deleted.

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
val name: String by settings
2+
rootProject.name = name

0 commit comments

Comments
 (0)