Skip to content

Commit 739483d

Browse files
committed
First version
1 parent 38a42f7 commit 739483d

18 files changed

+819
-19
lines changed

.github/workflows/commitTest.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Mod
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
buildJar:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up PATH
12+
run: |
13+
echo "${ANDROID_HOME}/build-tools/34.0.0" >> $GITHUB_PATH
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 17
18+
- name: Build mod jar
19+
run: |
20+
chmod +x ./gradlew
21+
./gradlew deploy
22+
- name: Upload built jar file
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: ${{ github.event.repository.name }}
26+
path: build/libs/${{ github.event.repository.name }}.jar

.gitignore

Lines changed: 150 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,156 @@
1-
# Compiled class file
2-
*.class
3-
4-
# Log file
5-
*.log
1+
logs/
2+
/core/assets/mindustry-saves/
3+
/core/assets/mindustry-maps/
4+
/core/assets/bundles/output/
5+
/core/assets/.gifimages/
6+
/deploy/
7+
/desktop/packr-out/
8+
/desktop/packr-export/
9+
/desktop/mindustry-saves/
10+
/desktop/mindustry-maps/
11+
/desktop/gifexport/
12+
/core/lib/
13+
/ios/assets/
14+
/core/assets-raw/sprites/generated/
15+
/core/assets-raw/sprites_out/
16+
/annotations/build/
17+
/annotations/out/
18+
/net/build/
19+
/tools/build/
20+
/tests/build/
21+
/server/build/
22+
/test_files/
23+
/annotations/build/
24+
/desktop-sdl/build/
25+
desktop-sdl/build/
26+
/android/assets/mindustry-maps/
27+
/android/assets/mindustry-saves/
28+
/core/assets/gifexport/
29+
/core/assets/version.properties
30+
/core/assets/locales
31+
/ios/src/io/anuke/mindustry/gen/
32+
/core/src/io/anuke/mindustry/gen/
33+
ios/robovm.properties
34+
packr-out/
35+
config/
36+
*.gif
637

7-
# BlueJ files
8-
*.ctxt
38+
version.properties
939

10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
40+
.attach_*
41+
## Java
1242

13-
# Package Files #
14-
*.jar
43+
*.class
1544
*.war
16-
*.nar
1745
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2346
hs_err_pid*
24-
replay_pid*
47+
crash-report-*
48+
49+
## Robovm
50+
/ios/robovm-build/
51+
52+
## GWT
53+
/html/war/
54+
/html/gwt-unitCache/
55+
.apt_generated/
56+
.gwt/
57+
gwt-unitCache/
58+
www-test/
59+
.gwt-tmp/
60+
61+
## Android Studio and Intellij and Android in general
62+
/android/libs/armeabi/
63+
/android/libs/armeabi-v7a/
64+
/android/libs/arm64-v8a/
65+
/android/libs/x86/
66+
/android/libs/x86_64/
67+
/android/gen/
68+
.idea/
69+
*.ipr
70+
*.iws
71+
*.iml
72+
/android/out/
73+
com_crashlytics_export_strings.xml
74+
75+
## Eclipse
76+
77+
.classpath
78+
.project
79+
.metadata/
80+
/android/bin/
81+
/core/bin/
82+
/desktop/bin/
83+
/html/bin/
84+
/ios/bin/
85+
/ios-moe/bin/
86+
*.tmp
87+
*.bak
88+
*.swp
89+
*~.nib
90+
.settings/
91+
.loadpath
92+
.externalToolBuilders/
93+
*.launch
94+
95+
## NetBeans
96+
97+
/nbproject/private/
98+
/android/nbproject/private/
99+
/core/nbproject/private/
100+
/desktop/nbproject/private/
101+
/html/nbproject/private/
102+
/ios/nbproject/private/
103+
/ios-moe/nbproject/private/
104+
105+
/build/
106+
/android/build/
107+
/core/build/
108+
/desktop/build/
109+
/html/build/
110+
/ios/build/
111+
/ios-moe/build/
112+
113+
/nbbuild/
114+
/android/nbbuild/
115+
/core/nbbuild/
116+
/desktop/nbbuild/
117+
/html/nbbuild/
118+
/ios/nbbuild/
119+
/ios-moe/nbbuild/
120+
121+
/dist/
122+
/android/dist/
123+
/core/dist/
124+
/desktop/dist/
125+
/html/dist/
126+
/ios/dist/
127+
/ios-moe/dist/
128+
129+
/nbdist/
130+
/android/nbdist/
131+
/core/nbdist/
132+
/desktop/nbdist/
133+
/html/nbdist/
134+
/ios/nbdist/
135+
/ios-moe/nbdist/
136+
137+
nbactions.xml
138+
nb-configuration.xml
139+
140+
## Gradle
141+
142+
/local.properties
143+
.gradle/
144+
gradle-app.setting
145+
/build/
146+
/android/build/
147+
/core/build/
148+
/desktop/build/
149+
/html/build/
150+
/ios/build/
151+
/ios-moe/build/
152+
153+
## OS Specific
154+
.DS_Store
155+
Thumbs.db
156+
android/libs/

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# MlogAssertions
2-
Provides custom mlog instructions for enhanced runtime checks in Mindustry Logic.
2+
3+
Provides custom mlog instructions for launch pads/landing pads.
4+
5+
The mod is still under development. The precise specification of instructions may still change.

assets/bundles/bundle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lcategory.landingpads = Launch/landing pads
2+
lcategory.asserts.description = Instructions for handling launchpads and landing pads
3+
4+
lst.redirect = Programmatically invoke the redirect button on a given landing pad

build.gradle

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
apply plugin: "java"
2+
3+
version '1.0'
4+
5+
sourceSets.main.java.srcDirs = ["src"]
6+
7+
repositories{
8+
mavenCentral()
9+
maven{ url "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository" }
10+
maven{ url 'https://www.jitpack.io' }
11+
}
12+
13+
java{
14+
targetCompatibility = 8
15+
sourceCompatibility = JavaVersion.VERSION_17
16+
}
17+
18+
ext{
19+
//the build number that this mod is made for
20+
mindustryVersion = 'v146'
21+
jabelVersion = "93fde537c7"
22+
//windows sucks
23+
isWindows = System.getProperty("os.name").toLowerCase().contains("windows")
24+
sdkRoot = System.getenv("ANDROID_HOME") ?: System.getenv("ANDROID_SDK_ROOT")
25+
modDir = "${System.getenv("APPDATA")}\\Mindustry\\mods"
26+
}
27+
28+
//java 8 backwards compatibility flag
29+
allprojects{
30+
tasks.withType(JavaCompile){
31+
options.compilerArgs.addAll(['--release', '8'])
32+
}
33+
}
34+
35+
dependencies{
36+
compileOnly "com.github.Anuken.Arc:arc-core:$mindustryVersion"
37+
// Manually put latest commit ID here from https://github.com/Anuken/MindustryJitpack/commits/main/
38+
compileOnly 'com.github.Anuken:MindustryJitpack:47cf3c4'
39+
40+
annotationProcessor "com.github.Anuken:jabel:$jabelVersion"
41+
}
42+
43+
//force arc version
44+
configurations.all{
45+
resolutionStrategy.eachDependency { details ->
46+
if(details.requested.group == 'com.github.Anuken.Arc'){
47+
details.useVersion "$mindustryVersion"
48+
}
49+
}
50+
}
51+
52+
task jarAndroid{
53+
dependsOn "jar"
54+
55+
doLast{
56+
if(!sdkRoot || !new File(sdkRoot).exists()) throw new GradleException("No valid Android SDK found. Ensure that ANDROID_HOME is set to your Android SDK directory.");
57+
58+
def platformRoot = new File("$sdkRoot/platforms/").listFiles().sort().reverse().find{ f -> new File(f, "android.jar").exists()}
59+
60+
if(!platformRoot) throw new GradleException("No android.jar found. Ensure that you have an Android platform installed.")
61+
62+
//collect dependencies needed for desugaring
63+
def dependencies = (configurations.compileClasspath.asList() + configurations.runtimeClasspath.asList() + [new File(platformRoot, "android.jar")]).collect{ "--classpath $it.path" }.join(" ")
64+
65+
def d8 = isWindows ? "d8.bat" : "d8"
66+
67+
//dex and desugar files - this requires d8 in your PATH
68+
"$d8 $dependencies --min-api 14 --output ${project.archivesBaseName}Android.jar ${project.archivesBaseName}Desktop.jar"
69+
.execute(null, new File("$buildDir/libs")).waitForProcessOutput(System.out, System.err)
70+
}
71+
}
72+
73+
jar{
74+
archiveFileName = "${base.archivesBaseName}Desktop.jar"
75+
76+
from{
77+
configurations.runtimeClasspath.collect{ it.isDirectory() ? it : zipTree(it) }
78+
}
79+
80+
from(projectDir){
81+
include "mod.hjson"
82+
include "icon.png"
83+
}
84+
85+
from("assets/"){
86+
include "**"
87+
}
88+
}
89+
90+
task deploy(type: Jar){
91+
dependsOn jarAndroid
92+
dependsOn jar
93+
archiveFileName = "${base.archivesBaseName}.jar"
94+
95+
from{ [zipTree("$buildDir/libs/${project.archivesBaseName}Desktop.jar"), zipTree("$buildDir/libs/${project.archivesBaseName}Android.jar")] }
96+
97+
doLast{
98+
delete{
99+
delete "$buildDir/libs/${project.archivesBaseName}Desktop.jar"
100+
delete "$buildDir/libs/${project.archivesBaseName}Android.jar"
101+
}
102+
}
103+
}
104+
105+
task compileAndCopy{
106+
dependsOn jar
107+
108+
doLast{
109+
copy{
110+
from "$buildDir/libs/"
111+
into "$modDir/"
112+
include "${project.archivesBaseName}Desktop.jar"
113+
}
114+
}
115+
}

gradle.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
org.gradle.jvmargs=--illegal-access=permit \
2+
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
3+
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
4+
--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
5+
--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
6+
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
7+
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
8+
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
9+
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
10+
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
11+
--add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
12+
--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
13+
--add-exports=java.base/sun.reflect.annotation=ALL-UNNAMED

gradle/wrapper/gradle-wrapper.jar

54.9 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)