Skip to content

Commit f9b313a

Browse files
committed
publish fix, with version, sources and javadocs
1 parent 66d19b8 commit f9b313a

File tree

3 files changed

+29
-19
lines changed

3 files changed

+29
-19
lines changed

build.gradle

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,28 @@ if (JavaVersion.current().isJava8Compatible()) {
5656
}
5757

5858
project(":gdx-ai") {
59-
apply from: '../publish.gradle'
59+
version project.getProperty('version') + (isReleaseBuild() ? "" : "-SNAPSHOT")
60+
61+
java {
62+
withJavadocJar()
63+
withSourcesJar()
64+
}
65+
66+
tasks.withType(JavaCompile).configureEach {
67+
options.encoding = 'UTF-8'
68+
}
69+
70+
tasks.withType(Test).configureEach {
71+
systemProperty 'file.encoding', 'UTF-8'
72+
}
73+
6074

6175
dependencies {
6276
api "com.badlogicgames.gdx:gdx:$gdxVersion"
6377
}
78+
79+
apply from: '../publish.gradle'
80+
6481
}
6582

6683
project(":tests") {

gdx-ai/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
apply plugin: "java"
21

32
sourceCompatibility = 1.7
43

@@ -9,7 +8,7 @@ sourceSets {
98
}
109

1110
resources {
12-
srcDirs = [ "src/" ]
11+
srcDirs = [ "src/**.*xml" ]
1312
}
1413
}
1514

publish.gradle

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ apply plugin: 'signing'
55
afterEvaluate { project ->
66
publishing {
77
publications {
8-
withType(MavenPublication) {
8+
mavenJava(MavenPublication) {
9+
from components.java
10+
versionMapping {
11+
usage('java-api') {
12+
fromResolutionOf('runtimeClasspath')
13+
}
14+
usage('java-runtime') {
15+
fromResolutionResult()
16+
}
17+
}
918
pom {
1019
name = POM_NAME
1120
description = POM_DESCRIPTION
@@ -30,21 +39,6 @@ afterEvaluate { project ->
3039
}
3140
}
3241
}
33-
//Check if we are a gradle plugin, if we are skip mavenJava
34-
if (!plugins.hasPlugin('java-gradle-plugin')) {
35-
mavenJava(MavenPublication) {
36-
37-
from components.java
38-
versionMapping {
39-
usage('java-api') {
40-
fromResolutionOf('runtimeClasspath')
41-
}
42-
usage('java-runtime') {
43-
fromResolutionResult()
44-
}
45-
}
46-
}
47-
}
4842
}
4943

5044
repositories {

0 commit comments

Comments
 (0)