Skip to content

Commit 5ca9a2f

Browse files
committed
Configure "build.gradle" for publication
1 parent 14999d4 commit 5ca9a2f

File tree

3 files changed

+72
-8
lines changed

3 files changed

+72
-8
lines changed

.idea/misc.xml

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

+68-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
plugins {
2-
id 'java'
2+
id 'java-library'
33

44
id 'maven-publish'
5+
id 'signing'
56
}
67

78
group = 'at.jddev0.lang'
8-
version = '1.0.0-beta-03-dev'
9+
version = '1.0.0-beta-03'
910

1011
repositories {
1112
mavenCentral()
@@ -20,14 +21,76 @@ test {
2021
useJUnitPlatform()
2122
}
2223

24+
java {
25+
withJavadocJar()
26+
withSourcesJar()
27+
}
28+
2329
publishing {
2430
publications {
25-
maven(MavenPublication) {
26-
groupId = 'at.jddev0.lang'
31+
mavenJava(MavenPublication) {
2732
artifactId = 'lang-interpreter'
28-
version = this.version
33+
groupId = 'at.jddev0.lang'
2934

3035
from components.java
36+
37+
versionMapping {
38+
usage('java-api') {
39+
fromResolutionOf('runtimeClasspath')
40+
}
41+
usage('java-runtime') {
42+
fromResolutionResult()
43+
}
44+
}
45+
46+
pom {
47+
packaging = 'jar'
48+
49+
name = 'Lang Interpreter'
50+
description = 'The Java reference implementation of the Lang Interpreter'
51+
url = 'https://github.com/lang-programming/lang-interpreter'
52+
licenses {
53+
license {
54+
name = 'MIT License'
55+
url = 'http://www.opensource.org/licenses/mit-license.php'
56+
}
57+
}
58+
developers {
59+
developer {
60+
id = 'jddev0'
61+
name = 'JDDev0'
62+
63+
}
64+
}
65+
scm {
66+
connection = 'scm:git:git://github.com/lang-programming/lang-interpreter.git'
67+
developerConnection = 'scm:git:ssh://github.com:lang-programming/lang-interpreter.git'
68+
url = 'https://github.com/lang-programming/lang-interpreter'
69+
}
70+
}
71+
}
72+
}
73+
74+
repositories {
75+
maven {
76+
def releasesRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/releases'
77+
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots'
78+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
79+
80+
credentials {
81+
username = getProperty('publishMavenUsername')
82+
password = getProperty('publishMavenPassword')
83+
}
3184
}
3285
}
86+
}
87+
88+
signing {
89+
sign publishing.publications.mavenJava
90+
}
91+
92+
javadoc {
93+
if(JavaVersion.current().isJava9Compatible()) {
94+
options.addBooleanOption('html5', true)
95+
}
3396
}

src/main/java/at/jddev0/lang/Lang.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public static Map<String, String> getTranslationMap(String langFile, boolean rel
178178
* Call getCached... methods afterwards for retrieving certain Lang translations
179179
* @return Returns all translations of <b>langFile</b> with a timeout
180180
* @param timeout Will cancel the execution of the Lang file after timeout milliseconds
181-
* @throws StoppedException if the execution of the Lang file was force stopped
181+
* @throws LangInterpreter.StoppedException if the execution of the Lang file was force stopped
182182
*/
183183
public static Map<String, String> getTranslationMapTimeout(String langFile, boolean reloadNotFromChache, int timeout, TerminalIO term, ILangPlatformAPI langPlatformAPI)
184184
throws IOException, LangInterpreter.StoppedException {
@@ -189,7 +189,7 @@ public static Map<String, String> getTranslationMapTimeout(String langFile, bool
189189
* Call getCached... methods afterwards for retrieving certain Lang translations
190190
* @return Returns all translations of <b>langFile</b> with a timeout
191191
* @param timeout Will cancel the execution of the Lang file after timeout milliseconds
192-
* @throws StoppedException if the execution of the Lang file was force stopped
192+
* @throws LangInterpreter.StoppedException if the execution of the Lang file was force stopped
193193
*/
194194
public static Map<String, String> getTranslationMapTimeout(String langFile, boolean reloadNotFromChache, int timeout, TerminalIO term, ILangPlatformAPI langPlatformAPI, String[] langArgs)
195195
throws IOException, LangInterpreter.StoppedException {

0 commit comments

Comments
 (0)