Skip to content

Commit fd55459

Browse files
committed
* update: README.md
* update: build.gradle to support publishing * update: delombok (issues with javadoc publishing)
1 parent 05d772c commit fd55459

24 files changed

+1775
-449
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Java LDTK API utility library
1+
# Java LDTK API data library
22

33
### What is this repository for? ###
44

build.gradle

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
apply plugin: 'java'
22
apply plugin: 'java-library'
3+
apply plugin: 'maven-publish'
4+
apply plugin: 'signing'
35

4-
version = '1.0'
6+
version = '1.0.0'
57

68
repositories {
79
mavenCentral()
@@ -25,3 +27,74 @@ dependencies {
2527
test {
2628
useJUnitPlatform()
2729
}
30+
31+
task sourceJar(type: Jar) {
32+
classifier "sources"
33+
from sourceSets.main.allJava
34+
}
35+
36+
task javadocJar(type: Jar, dependsOn: javadoc) {
37+
classifier "javadoc"
38+
from javadoc.destinationDir
39+
}
40+
41+
signing {
42+
if (rootProject.hasProperty("signing.keyId")) {
43+
sign(publishing.publications) // sign everything to be published
44+
}
45+
}
46+
47+
publishing {
48+
publications {
49+
mavenJava(MavenPublication) {
50+
groupId 'io.github.joafalves'
51+
artifactId project.name
52+
version rootProject.version
53+
54+
from components.java
55+
56+
artifact(sourceJar) {
57+
classifier = 'sources'
58+
}
59+
60+
artifact(javadocJar) {
61+
classifier = 'javadoc'
62+
}
63+
64+
pom {
65+
name = 'Java LDTK API data library'
66+
description = 'Java LDTK API utility library for loading LDTK json files into data classes.'
67+
url = 'https://github.com/joafalves/java-ldtk-api'
68+
licenses {
69+
license {
70+
name = 'The Apache License, Version 2.0'
71+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
72+
}
73+
}
74+
developers {
75+
developer {
76+
id = 'jfalves'
77+
name = 'João Alves'
78+
79+
}
80+
}
81+
scm {
82+
connection = 'scm:git:git://github.com/joafalves/java-ldtk-api.git'
83+
developerConnection = 'scm:git:ssh://github.com/joafalves/java-ldtk-api.git'
84+
url = 'https://github.com/joafalves/java-ldtk-api'
85+
}
86+
}
87+
}
88+
}
89+
repositories {
90+
if (rootProject.hasProperty("sonatypeUsername") && rootProject.hasProperty("sonatypePassword")) {
91+
maven {
92+
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
93+
credentials {
94+
username sonatypeUsername
95+
password sonatypePassword
96+
}
97+
}
98+
}
99+
}
100+
}

src/main/java/io/github/joafalves/ldtk/model/AutoLayerRuleDefinition.java

Lines changed: 152 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,178 @@
88
* completely resolved internally by the editor before any saving. You should just ignore
99
* this part.
1010
*/
11-
@lombok.Data
1211
@JsonIgnoreProperties(ignoreUnknown = true)
1312
public class AutoLayerRuleDefinition {
14-
@lombok.Getter(onMethod_ = {@JsonProperty("active")})
15-
@lombok.Setter(onMethod_ = {@JsonProperty("active")})
1613
private boolean active;
17-
@lombok.Getter(onMethod_ = {@JsonProperty("breakOnMatch")})
18-
@lombok.Setter(onMethod_ = {@JsonProperty("breakOnMatch")})
1914
private boolean breakOnMatch;
20-
@lombok.Getter(onMethod_ = {@JsonProperty("chance")})
21-
@lombok.Setter(onMethod_ = {@JsonProperty("chance")})
2215
private double chance;
23-
@lombok.Getter(onMethod_ = {@JsonProperty("checker")})
24-
@lombok.Setter(onMethod_ = {@JsonProperty("checker")})
2516
private Checker checker;
26-
@lombok.Getter(onMethod_ = {@JsonProperty("flipX")})
27-
@lombok.Setter(onMethod_ = {@JsonProperty("flipX")})
2817
private boolean flipX;
29-
@lombok.Getter(onMethod_ = {@JsonProperty("flipY")})
30-
@lombok.Setter(onMethod_ = {@JsonProperty("flipY")})
3118
private boolean flipY;
32-
@lombok.Getter(onMethod_ = {@JsonProperty("outOfBoundsValue")})
33-
@lombok.Setter(onMethod_ = {@JsonProperty("outOfBoundsValue")})
3419
private Long outOfBoundsValue;
35-
@lombok.Getter(onMethod_ = {@JsonProperty("pattern")})
36-
@lombok.Setter(onMethod_ = {@JsonProperty("pattern")})
3720
private List<Long> pattern;
38-
@lombok.Getter(onMethod_ = {@JsonProperty("perlinActive")})
39-
@lombok.Setter(onMethod_ = {@JsonProperty("perlinActive")})
4021
private boolean perlinActive;
41-
@lombok.Getter(onMethod_ = {@JsonProperty("perlinOctaves")})
42-
@lombok.Setter(onMethod_ = {@JsonProperty("perlinOctaves")})
4322
private double perlinOctaves;
44-
@lombok.Getter(onMethod_ = {@JsonProperty("perlinScale")})
45-
@lombok.Setter(onMethod_ = {@JsonProperty("perlinScale")})
4623
private double perlinScale;
47-
@lombok.Getter(onMethod_ = {@JsonProperty("perlinSeed")})
48-
@lombok.Setter(onMethod_ = {@JsonProperty("perlinSeed")})
4924
private double perlinSeed;
50-
@lombok.Getter(onMethod_ = {@JsonProperty("pivotX")})
51-
@lombok.Setter(onMethod_ = {@JsonProperty("pivotX")})
5225
private double pivotX;
53-
@lombok.Getter(onMethod_ = {@JsonProperty("pivotY")})
54-
@lombok.Setter(onMethod_ = {@JsonProperty("pivotY")})
5526
private double pivotY;
56-
@lombok.Getter(onMethod_ = {@JsonProperty("size")})
57-
@lombok.Setter(onMethod_ = {@JsonProperty("size")})
5827
private long size;
59-
@lombok.Getter(onMethod_ = {@JsonProperty("tileIds")})
60-
@lombok.Setter(onMethod_ = {@JsonProperty("tileIds")})
6128
private List<Long> tileIDS;
62-
@lombok.Getter(onMethod_ = {@JsonProperty("tileMode")})
63-
@lombok.Setter(onMethod_ = {@JsonProperty("tileMode")})
6429
private TileMode tileMode;
65-
@lombok.Getter(onMethod_ = {@JsonProperty("uid")})
66-
@lombok.Setter(onMethod_ = {@JsonProperty("uid")})
6730
private long uid;
68-
@lombok.Getter(onMethod_ = {@JsonProperty("xModulo")})
69-
@lombok.Setter(onMethod_ = {@JsonProperty("xModulo")})
7031
private long xModulo;
71-
@lombok.Getter(onMethod_ = {@JsonProperty("yModulo")})
72-
@lombok.Setter(onMethod_ = {@JsonProperty("yModulo")})
7332
private long yModulo;
33+
34+
/**
35+
* If FALSE, the rule effect isn't applied, and no tiles are generated.
36+
*/
37+
@JsonProperty("active")
38+
public boolean getActive() { return active; }
39+
@JsonProperty("active")
40+
public void setActive(boolean value) { this.active = value; }
41+
42+
/**
43+
* When TRUE, the rule will prevent other rules to be applied in the same cell if it matches
44+
* (TRUE by default).
45+
*/
46+
@JsonProperty("breakOnMatch")
47+
public boolean getBreakOnMatch() { return breakOnMatch; }
48+
@JsonProperty("breakOnMatch")
49+
public void setBreakOnMatch(boolean value) { this.breakOnMatch = value; }
50+
51+
/**
52+
* Chances for this rule to be applied (0 to 1)
53+
*/
54+
@JsonProperty("chance")
55+
public double getChance() { return chance; }
56+
@JsonProperty("chance")
57+
public void setChance(double value) { this.chance = value; }
58+
59+
/**
60+
* Checker mode Possible values: `None`, `Horizontal`, `Vertical`
61+
*/
62+
@JsonProperty("checker")
63+
public Checker getChecker() { return checker; }
64+
@JsonProperty("checker")
65+
public void setChecker(Checker value) { this.checker = value; }
66+
67+
/**
68+
* If TRUE, allow rule to be matched by flipping its pattern horizontally
69+
*/
70+
@JsonProperty("flipX")
71+
public boolean getFlipX() { return flipX; }
72+
@JsonProperty("flipX")
73+
public void setFlipX(boolean value) { this.flipX = value; }
74+
75+
/**
76+
* If TRUE, allow rule to be matched by flipping its pattern vertically
77+
*/
78+
@JsonProperty("flipY")
79+
public boolean getFlipY() { return flipY; }
80+
@JsonProperty("flipY")
81+
public void setFlipY(boolean value) { this.flipY = value; }
82+
83+
/**
84+
* Default IntGrid value when checking cells outside of level bounds
85+
*/
86+
@JsonProperty("outOfBoundsValue")
87+
public Long getOutOfBoundsValue() { return outOfBoundsValue; }
88+
@JsonProperty("outOfBoundsValue")
89+
public void setOutOfBoundsValue(Long value) { this.outOfBoundsValue = value; }
90+
91+
/**
92+
* Rule pattern (size x size)
93+
*/
94+
@JsonProperty("pattern")
95+
public List<Long> getPattern() { return pattern; }
96+
@JsonProperty("pattern")
97+
public void setPattern(List<Long> value) { this.pattern = value; }
98+
99+
/**
100+
* If TRUE, enable Perlin filtering to only apply rule on specific random area
101+
*/
102+
@JsonProperty("perlinActive")
103+
public boolean getPerlinActive() { return perlinActive; }
104+
@JsonProperty("perlinActive")
105+
public void setPerlinActive(boolean value) { this.perlinActive = value; }
106+
107+
@JsonProperty("perlinOctaves")
108+
public double getPerlinOctaves() { return perlinOctaves; }
109+
@JsonProperty("perlinOctaves")
110+
public void setPerlinOctaves(double value) { this.perlinOctaves = value; }
111+
112+
@JsonProperty("perlinScale")
113+
public double getPerlinScale() { return perlinScale; }
114+
@JsonProperty("perlinScale")
115+
public void setPerlinScale(double value) { this.perlinScale = value; }
116+
117+
@JsonProperty("perlinSeed")
118+
public double getPerlinSeed() { return perlinSeed; }
119+
@JsonProperty("perlinSeed")
120+
public void setPerlinSeed(double value) { this.perlinSeed = value; }
121+
122+
/**
123+
* X pivot of a tile stamp (0-1)
124+
*/
125+
@JsonProperty("pivotX")
126+
public double getPivotX() { return pivotX; }
127+
@JsonProperty("pivotX")
128+
public void setPivotX(double value) { this.pivotX = value; }
129+
130+
/**
131+
* Y pivot of a tile stamp (0-1)
132+
*/
133+
@JsonProperty("pivotY")
134+
public double getPivotY() { return pivotY; }
135+
@JsonProperty("pivotY")
136+
public void setPivotY(double value) { this.pivotY = value; }
137+
138+
/**
139+
* Pattern width and height. Should only be 1,3,5 or 7.
140+
*/
141+
@JsonProperty("size")
142+
public long getSize() { return size; }
143+
@JsonProperty("size")
144+
public void setSize(long value) { this.size = value; }
145+
146+
/**
147+
* Array of all the tile IDs. They are used randomly or as stamps, based on `tileMode` value.
148+
*/
149+
@JsonProperty("tileIds")
150+
public List<Long> getTileIDS() { return tileIDS; }
151+
@JsonProperty("tileIds")
152+
public void setTileIDS(List<Long> value) { this.tileIDS = value; }
153+
154+
/**
155+
* Defines how tileIds array is used Possible values: `Single`, `Stamp`
156+
*/
157+
@JsonProperty("tileMode")
158+
public TileMode getTileMode() { return tileMode; }
159+
@JsonProperty("tileMode")
160+
public void setTileMode(TileMode value) { this.tileMode = value; }
161+
162+
/**
163+
* Unique Int identifier
164+
*/
165+
@JsonProperty("uid")
166+
public long getUid() { return uid; }
167+
@JsonProperty("uid")
168+
public void setUid(long value) { this.uid = value; }
169+
170+
/**
171+
* X cell coord modulo
172+
*/
173+
@JsonProperty("xModulo")
174+
public long getXModulo() { return xModulo; }
175+
@JsonProperty("xModulo")
176+
public void setXModulo(long value) { this.xModulo = value; }
177+
178+
/**
179+
* Y cell coord modulo
180+
*/
181+
@JsonProperty("yModulo")
182+
public long getYModulo() { return yModulo; }
183+
@JsonProperty("yModulo")
184+
public void setYModulo(long value) { this.yModulo = value; }
74185
}

src/main/java/io/github/joafalves/ldtk/model/AutoLayerRuleGroup.java

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,42 @@
33
import com.fasterxml.jackson.annotation.*;
44
import java.util.List;
55

6-
@lombok.Data
76
@JsonIgnoreProperties(ignoreUnknown = true)
87
public class AutoLayerRuleGroup {
9-
@lombok.Getter(onMethod_ = {@JsonProperty("active")})
10-
@lombok.Setter(onMethod_ = {@JsonProperty("active")})
118
private boolean active;
12-
@lombok.Getter(onMethod_ = {@JsonProperty("collapsed")})
13-
@lombok.Setter(onMethod_ = {@JsonProperty("collapsed")})
149
private boolean collapsed;
15-
@lombok.Getter(onMethod_ = {@JsonProperty("isOptional")})
16-
@lombok.Setter(onMethod_ = {@JsonProperty("isOptional")})
1710
private boolean isOptional;
18-
@lombok.Getter(onMethod_ = {@JsonProperty("name")})
19-
@lombok.Setter(onMethod_ = {@JsonProperty("name")})
2011
private String name;
21-
@lombok.Getter(onMethod_ = {@JsonProperty("rules")})
22-
@lombok.Setter(onMethod_ = {@JsonProperty("rules")})
2312
private List<AutoLayerRuleDefinition> rules;
24-
@lombok.Getter(onMethod_ = {@JsonProperty("uid")})
25-
@lombok.Setter(onMethod_ = {@JsonProperty("uid")})
2613
private long uid;
14+
15+
@JsonProperty("active")
16+
public boolean getActive() { return active; }
17+
@JsonProperty("active")
18+
public void setActive(boolean value) { this.active = value; }
19+
20+
@JsonProperty("collapsed")
21+
public boolean getCollapsed() { return collapsed; }
22+
@JsonProperty("collapsed")
23+
public void setCollapsed(boolean value) { this.collapsed = value; }
24+
25+
@JsonProperty("isOptional")
26+
public boolean getIsOptional() { return isOptional; }
27+
@JsonProperty("isOptional")
28+
public void setIsOptional(boolean value) { this.isOptional = value; }
29+
30+
@JsonProperty("name")
31+
public String getName() { return name; }
32+
@JsonProperty("name")
33+
public void setName(String value) { this.name = value; }
34+
35+
@JsonProperty("rules")
36+
public List<AutoLayerRuleDefinition> getRules() { return rules; }
37+
@JsonProperty("rules")
38+
public void setRules(List<AutoLayerRuleDefinition> value) { this.rules = value; }
39+
40+
@JsonProperty("uid")
41+
public long getUid() { return uid; }
42+
@JsonProperty("uid")
43+
public void setUid(long value) { this.uid = value; }
2744
}

0 commit comments

Comments
 (0)