Skip to content

Commit d8deec8

Browse files
authored
Switch repo to maven.minecrafttas.com (#33)
- Publish new things on https://maven.minecrafttas.com/#/main - Add workflow for merging into develop to publish the snapshot - Add workflow for releasing to publish main and snapshot - Javadoc errors
2 parents 560ef7a + 63b3c64 commit d8deec8

File tree

6 files changed

+90
-17
lines changed

6 files changed

+90
-17
lines changed

.github/workflows/publish-main.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Publish Main to https://maven.minecrafttas.com/main
2+
name: Publish Main
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'MinecraftTAS/Discombobulator'
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 23 for x64
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: '23'
18+
distribution: 'temurin'
19+
architecture: x64
20+
- name: Setup Gradle
21+
uses: gradle/actions/setup-gradle@v3
22+
with:
23+
gradle-version: 8.13
24+
- name: Publish
25+
run: gradle publishAllPublicationsToMinecrafttasMainRepository
26+
env:
27+
MAVEN_NAME: ${{ secrets.MAVEN_NAME }}
28+
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Publish snapshot to https://maven.minecrafttas.com/snapshots
2+
name: Publish Snapshot
3+
4+
on: [push]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
if: github.repository == 'MinecraftTAS/Discombobulator'
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up JDK 23 for x64
13+
uses: actions/setup-java@v4
14+
with:
15+
java-version: '23'
16+
distribution: 'temurin'
17+
architecture: x64
18+
- name: Setup Gradle
19+
uses: gradle/actions/setup-gradle@v3
20+
with:
21+
gradle-version: 8.13
22+
- name: Publish
23+
run: gradle publishAllPublicationsToMinecrafttasSnapshotsRepository
24+
env:
25+
MAVEN_NAME: ${{ secrets.MAVEN_NAME }}
26+
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Gradle
2121
uses: gradle/actions/setup-gradle@v4
2222
with:
23-
gradle-version: 8.12.1
23+
gradle-version: 8.13
2424
- name: Build
2525
run: gradle build
2626
- name: Upload Test Report

Test/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pluginManagement {
22
repositories {
33
mavenLocal() // For development purposes
44
mavenCentral()
5-
maven { url = "https://maven.mgnet.work/main" }
5+
maven { url = "https://maven.minecrafttas.com/main" }
66
maven { url = "https://maven.fabricmc.net" }
77
gradlePluginPortal()
88
}

build.gradle

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
sourceCompatibility = targetCompatibility = 23
99

1010
// Name, version and group for the project
11-
version = "1.3-SNAPSHOT"
11+
version = "1.3"
1212
group = "com.minecrafttas"
1313
archivesBaseName = "discombobulator"
1414

@@ -39,11 +39,29 @@ test {
3939
}
4040
}
4141

42+
java {
43+
withSourcesJar()
44+
withJavadocJar()
45+
}
46+
47+
javadoc {
48+
options.locale = "en_US"
49+
}
50+
4251
publishing {
4352
repositories {
4453
maven {
45-
name = "mgnetwork"
46-
url = "https://maven.mgnet.work/main"
54+
version = version + "-SNAPSHOT"
55+
name = "minecrafttasSnapshots"
56+
url = "https://maven.minecrafttas.com/snapshots"
57+
credentials(PasswordCredentials)
58+
authentication {
59+
basic(BasicAuthentication)
60+
}
61+
}
62+
maven {
63+
name = "minecrafttasMain"
64+
url = "https://maven.minecrafttas.com/main"
4765
credentials(PasswordCredentials)
4866
authentication {
4967
basic(BasicAuthentication)

src/main/java/com/minecrafttas/discombobulator/processor/LinePreprocessor.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
import com.minecrafttas.discombobulator.utils.Pair;
1212

13-
/*Welcome to the madness that is this preprocessor. Here I will try as best as I can to explain how this works.
13+
/*
14+
* Welcome to the madness that is this preprocessor. Here I will try as best as I can to explain how this works.
1415
* Why am I explaining it? Because my hope is, that at least I can remember what the hell I was doing when I made this
1516
*
1617
* Start of with the "preprocess" method which is the only public method here.
@@ -48,7 +49,7 @@ public class LinePreprocessor {
4849
* "1.20",
4950
* "1.19",
5051
* "1.18",
51-
* "1.16" <- default version since it's the lowest
52+
* "1.16" &lt;- default version since it's the lowest
5253
* ]
5354
* </pre>
5455
* @param versions The versions to check for in an order
@@ -64,7 +65,7 @@ public LinePreprocessor(List<String> versions, Map<String, Map<String, String>>
6465
*
6566
* <pre>
6667
* [
67-
* "1.20", <- default version since it's the highest
68+
* "1.20", &lt;- default version since it's the highest
6869
* "1.19",
6970
* "1.18",
7071
* "1.16"
@@ -83,15 +84,15 @@ public LinePreprocessor(List<String> versions, Map<String, Map<String, String>>
8384
}
8485

8586
/**
86-
* Preprocesses the lines to a targeted version.
87+
* <p>Preprocesses the lines to a targeted version.
8788
* <p>Preprocessing can happen in 2 ways:<br>
8889
* <ol>
8990
* <li>Preprocessing a block of code</li>
9091
* <li>Preprocessing a specific line of code with patterns</li>
9192
* </ol>
9293
* <p>The advantage of pattern processing is that you can save yourself some work making a version block for common patterns like <code>Minecraft.getMinecraft().player</code> in 1.12 to <code>Minecraft.getMinecraft().thePlayer</code> in e.g. 1.10
9394
*
94-
* <h2>VersionBlock</h2>
95+
* <h4>VersionBlock</h4>
9596
* <p>A version block allows you to uncomment part of the code in certain versions via comments:
9697
* <pre>
9798
* //# 1.12.2
@@ -107,7 +108,7 @@ public LinePreprocessor(List<String> versions, Map<String, Map<String, String>>
107108
*
108109
* <p>You can define these blocks out of order (e.g. first 1.9.4 then 1.12.2)... The version order is ultimately defined in the build.gradle.
109110
*
110-
* <h3>Nesting</h3>
111+
* <h5>Nesting</h5>
111112
*
112113
* <p>Sometimes you have a lot of changes in one version but a tiny amount is added in the following versions. In these cases, you would need to copy all the large changes again into the newest version:
113114
*
@@ -139,9 +140,9 @@ public LinePreprocessor(List<String> versions, Map<String, Map<String, String>>
139140
* than the changes in
140141
* 1.16.5
141142
*
142-
* //## 1.16.5 <-- 2 hashtags define the nested version
143+
* //## 1.16.5 &lt;-- 2 hashtags define the nested version
143144
* New things in 1.16.5
144-
* //## end <-- The end of the nested block is defined with 2 hashtags as well
145+
* //## end &lt;-- The end of the nested block is defined with 2 hashtags as well
145146
*
146147
* //# end
147148
* </pre>
@@ -157,7 +158,7 @@ public LinePreprocessor(List<String> versions, Map<String, Map<String, String>>
157158
* <li>Using def in a nested block will use the parent version</li>
158159
* </ul>
159160
*
160-
* <h2>Patterns</h2>
161+
* <h4>Patterns</h4>
161162
* Patterns are defined in the build.gradle:
162163
*
163164
* <pre>
@@ -186,7 +187,7 @@ public LinePreprocessor(List<String> versions, Map<String, Map<String, String>>
186187
*
187188
* @param targetVersion The version for which lines should be enabled
188189
* @param lines The lines to preprocess
189-
* @param filename Debug filename for errors during preprocessing
190+
* @param fileending The fileending of the preprocess file for applying different comment types
190191
* @return The preprocessed lines of the file
191192
* @throws Exception
192193
*/
@@ -253,7 +254,7 @@ public List<String> preprocess(String targetVersion, List<String> lines, String
253254
* Generates a list of version blocks by prereading the block. To take nesting into account, it generates the lists recursively. Most of the error checking is done here.
254255
* <pre>
255256
* 1.16.1
256-
* 1.16.5 <- (Nested versions)
257+
* 1.16.5 &lt;- (Nested versions)
257258
* 1.17.1
258259
* end
259260
* 1.18.1
@@ -285,7 +286,7 @@ public List<String> preprocess(String targetVersion, List<String> lines, String
285286
* </pre>
286287
* <p>Note that the last end has to be true, since everything outside a version block list is enabled by default
287288
* <pre>
288-
* public void example() { <-Outside a block, so line is not commented out by default
289+
* public void example() { &lt;-Outside a block, so line is not commented out by default
289290
* // # 1.16.1
290291
* //CODE!
291292
* // # end

0 commit comments

Comments
 (0)