Skip to content

Commit d78b7ff

Browse files
committed
Prepare project for release to Maven Central
1 parent f3b4905 commit d78b7ff

8 files changed

Lines changed: 96 additions & 9 deletions

File tree

build.gradle.kts

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,93 @@
1-
21
plugins {
3-
java
2+
`java-library`
3+
signing
4+
`maven-publish`
5+
id("net.minecrell.licenser") version "0.4.1"
46
}
57

68
group = "com.demonwav.mcdev"
79

810
java {
911
sourceCompatibility = JavaVersion.VERSION_1_8
1012
targetCompatibility = JavaVersion.VERSION_1_8
13+
withSourcesJar()
14+
withJavadocJar()
15+
}
16+
17+
license {
18+
header = file("header.txt")
19+
}
20+
21+
val isSnapshot = version.toString().endsWith("-SNAPSHOT")
22+
23+
publishing {
24+
publications {
25+
register<MavenPublication>("mavenJava") {
26+
groupId = project.group.toString()
27+
artifactId = project.name
28+
version = project.version.toString()
29+
30+
from(components["java"])
31+
withoutBuildIdentifier()
32+
33+
pom {
34+
val repoUrl = "https://github.com/minecraft-dev/annotations"
35+
36+
name.set("Minecraft Dev Annotations")
37+
description.set("Annotations for the Minecraft Development for IntelliJ plugin to assist with static code analysis.")
38+
url.set(repoUrl)
39+
inceptionYear.set("2020")
40+
packaging = "jar"
41+
42+
licenses {
43+
license {
44+
name.set("MIT")
45+
url.set("$repoUrl/blob/master/license.txt")
46+
distribution.set("repo")
47+
}
48+
}
49+
50+
issueManagement {
51+
system.set("GitHub")
52+
url.set("$repoUrl/issues")
53+
}
54+
55+
developers {
56+
developer {
57+
id.set("DemonWav")
58+
name.set("Kyle Wood")
59+
email.set("demonwav@gmail.com")
60+
url.set("https://github.com/DemonWav")
61+
}
62+
}
63+
64+
scm {
65+
url.set(repoUrl)
66+
connection.set("scm:git:$repoUrl.git")
67+
developerConnection.set(connection)
68+
}
69+
}
70+
}
71+
72+
repositories {
73+
val url = if (isSnapshot) {
74+
"https://oss.sonatype.org/content/repositories/snapshots/"
75+
} else {
76+
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"
77+
}
78+
maven(url) {
79+
credentials(PasswordCredentials::class)
80+
name = "osshr"
81+
}
82+
}
83+
}
84+
}
85+
86+
signing {
87+
useGpgCmd()
88+
sign(publishing.publications["mavenJava"])
89+
}
90+
91+
tasks.withType<Sign> {
92+
onlyIf { !isSnapshot }
1193
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
21
version = 1.0

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip

header.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Minecraft Dev for IntelliJ Annotations
2+
3+
https://minecraftdev.org
4+
5+
Copyright (c) 2020 minecraft-dev
6+
7+
MIT License

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# MinecraftDev Annotations
22

3-
Annotations for the Minecraft Development plugin for IntelliJ.
3+
Annotations for the Minecraft Development for IntelliJ plugin to assist with static code analysis.

settings.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
21
rootProject.name = "annotations"

src/main/java/com/demonwav/mcdev/annotations/CheckEnv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
@Documented
3131
public @interface CheckEnv {
3232
/**
33-
* The environment in which this element should only be accessed.
33+
* @return The environment in which this element should only be accessed.
3434
*/
3535
Env value();
3636
}

src/main/java/com/demonwav/mcdev/annotations/Env.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
/**
1414
* An environment, or distribution, of Minecraft.
1515
*
16-
* @see net.minecraftforge.api.distmarker.Dist
17-
* @see net.fabricmc.api.EnvType
16+
* This is analogous to {@code net.minecraftforge.api.distmarker.Dist} in Forge and {@code net.fabricmc.api.EnvType}
17+
* in Fabric.
1818
*/
1919
public enum Env {
2020
/**

0 commit comments

Comments
 (0)