Skip to content

Commit 61637a1

Browse files
committed
sync 2024/7/18
1 parent b5dd572 commit 61637a1

9 files changed

+575
-425
lines changed

patches/client/0001-BUILD-build.gradle.kts-and-clear.patch

-6
Original file line numberDiff line numberDiff line change
@@ -595,12 +595,6 @@ index 9bca8edb256e33ff341e5cae71c6b2922811a720..0cb5c6337c2d6a41243907d2c34c679b
595595
diff --git a/core/build.gradle b/core/build.gradle
596596
deleted file mode 100644
597597
index f7f291ef1ab71577313759a7e9fdfd3c1e0833dc..0000000000000000000000000000000000000000
598-
--- a/core/build.gradle
599-
+++ /dev/null
600-
@@ -1,2 +0,0 @@
601-
-sourceSets.main.java.srcDirs = ["src/", "$buildDir/generated/sources/annotationProcessor/java/main"]
602-
-sourceSets.main.kotlin.srcDirs = ["src/"]
603-
\ No newline at end of file
604598
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
605599
new file mode 100644
606600
index 0000000000000000000000000000000000000000..e2a6d4ede97677940bc6b73de42f6f5ff71fc0be

patches/client/0030-API-ui.Format.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ way-zer <[email protected]> on 2024/6/14
1818

1919
diff --git a/core/src/mindustryX/features/ui/Format.kt b/core/src/mindustryX/features/ui/Format.kt
2020
new file mode 100644
21-
index 0000000000000000000000000000000000000000..297ed9e0a20b04decf39f58419f8c9b6f9cc7fd8
21+
index 0000000000000000000000000000000000000000..0a61abc0d266f8c3ba93285b6a35eb85f9190f54
2222
--- /dev/null
2323
+++ b/core/src/mindustryX/features/ui/Format.kt
2424
@@ -0,0 +1,123 @@
@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..297ed9e0a20b04decf39f58419f8c9b6
3131
+import kotlin.math.abs
3232
+
3333
+@Suppress("MemberVisibilityCanBePrivate")
34-
+data class Format @JvmOverloads constructor(private var decimal: Int = 2, private var fixDecimals: Boolean = false) {
34+
+data class Format @JvmOverloads constructor(var decimal: Int = 2, var fixDecimals: Boolean = false) {
3535
+ /**以固定的有效位数输出*/
3636
+ fun fixedPrecision(v: Float): String {
3737
+ val exponent = Mathf.floor(Mathf.log(10f, abs(v)))

patches/client/0036-BUILD-workflows.patch

-191
Original file line numberDiff line numberDiff line change
@@ -89,200 +89,9 @@ index 0000000000000000000000000000000000000000..0cd3e1cb4f412b11074f75396882876a
8989
diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml
9090
deleted file mode 100644
9191
index 224a753d655956445b2f885b0ea7ace56de4bbd5..0000000000000000000000000000000000000000
92-
--- a/.github/workflows/deployment.yml
93-
+++ /dev/null
94-
@@ -1,93 +0,0 @@
95-
-name: Deployment
96-
-
97-
-on:
98-
- push:
99-
- tags:
100-
- - 'v*'
101-
-
102-
-permissions: {}
103-
-jobs:
104-
- deploy:
105-
- permissions:
106-
- contents: write # for release creation (svenstaro/upload-release-action)
107-
-
108-
- runs-on: ubuntu-latest
109-
-
110-
- steps:
111-
- - uses: actions/checkout@v2
112-
- - name: Set up JDK 17
113-
- uses: actions/setup-java@v1
114-
- with:
115-
- java-version: 17
116-
- - name: Set env
117-
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
118-
- - name: Add Arc release
119-
- run: |
120-
- git config --global user.email "[email protected]"
121-
- git config --global user.name "Github Actions"
122-
- git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc
123-
- cd ../Arc
124-
- git tag ${RELEASE_VERSION}
125-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/Arc ${RELEASE_VERSION};
126-
- cd ../Mindustry
127-
- - name: Update JITpack repo
128-
- run: |
129-
- cd ../
130-
- cp -r ./Mindustry ./MindustryJitpack
131-
- cd MindustryJitpack
132-
- git config --global user.name "Github Actions"
133-
- git config --global user.email "[email protected]"
134-
- git clone --depth 1 https://github.com/Anuken/MindustryJitpack.git
135-
- rm -rf .git
136-
- cp -r ./MindustryJitpack/.git ./.git
137-
- rm -rf MindustryJitpack
138-
- rm -rf .github
139-
- rm README.md
140-
- git add .
141-
- git commit --allow-empty -m "Updating"
142-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack
143-
- git tag ${RELEASE_VERSION}
144-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack
145-
- cd ../Mindustry
146-
- - name: Create artifacts
147-
- run: |
148-
- ./gradlew desktop:dist server:dist core:mergedJavadoc -Pbuildversion=${RELEASE_VERSION:1}
149-
- - name: Update docs
150-
- run: |
151-
- cd ../
152-
- git config --global user.email "[email protected]"
153-
- git config --global user.name "Github Actions"
154-
- git clone --depth=1 https://github.com/MindustryGame/docs.git
155-
- cd docs
156-
- find . -maxdepth 1 ! -name ".git" ! -name . -exec rm -r {} \;
157-
- cd ../
158-
- cp -a Mindustry/core/build/javadoc/. docs/
159-
- cd docs
160-
- git add .
161-
- git commit --allow-empty -m "Update ${RELEASE_VERSION:1}"
162-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/MindustryGame/docs
163-
- cd ../Mindustry
164-
- - name: Update F-Droid build string
165-
- run: |
166-
- git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
167-
- cd ../MindustryBuilds
168-
- echo "Updating version to ${RELEASE_VERSION:1}"
169-
- BNUM=$(($GITHUB_RUN_NUMBER + 1000))
170-
- echo versionName=7-fdroid-${RELEASE_VERSION:1}$'\n'versionCode=${BNUM} > version_fdroid.txt
171-
- git add .
172-
- git commit -m "Updating to build ${RELEASE_VERSION:1}"
173-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds
174-
- cd ../Mindustry
175-
- - name: Upload client artifacts
176-
- uses: svenstaro/upload-release-action@v2
177-
- with:
178-
- repo_token: ${{ secrets.GITHUB_TOKEN }}
179-
- file: desktop/build/libs/Mindustry.jar
180-
- tag: ${{ github.ref }}
181-
- - name: Upload server artifacts
182-
- uses: svenstaro/upload-release-action@v2
183-
- with:
184-
- repo_token: ${{ secrets.GITHUB_TOKEN }}
185-
- file: server/build/libs/server-release.jar
186-
- tag: ${{ github.ref }}
187-
-
18892
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
18993
deleted file mode 100644
19094
index eb2dcff192d52a8515331a2f058e86c65c0ae98b..0000000000000000000000000000000000000000
191-
--- a/.github/workflows/pr.yml
192-
+++ /dev/null
193-
@@ -1,28 +0,0 @@
194-
-name: Pull Request Tests
195-
-
196-
-on: [pull_request, workflow_dispatch]
197-
-
198-
-permissions:
199-
- contents: read # to fetch code (actions/checkout)
200-
-
201-
-jobs:
202-
- testPR:
203-
- runs-on: ubuntu-latest
204-
-
205-
- steps:
206-
- - uses: actions/checkout@v2
207-
- - name: Set up JDK 17
208-
- uses: actions/setup-java@v1
209-
- with:
210-
- java-version: 17
211-
- - name: Setup Gradle
212-
- uses: gradle/gradle-build-action@v2
213-
- - name: Run unit tests
214-
- run: ./gradlew tests:test --stacktrace --rerun
215-
- - name: Run unit tests and build JAR
216-
- run: ./gradlew desktop:dist
217-
- - name: Upload desktop JAR for testing
218-
- uses: actions/upload-artifact@v2
219-
- with:
220-
- name: Desktop JAR (zipped)
221-
- path: desktop/build/libs/Mindustry.jar
22295
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
22396
deleted file mode 100644
22497
index cd593a6dfdf55b4e70e548ab1d96f64d5354056d..0000000000000000000000000000000000000000
225-
--- a/.github/workflows/push.yml
226-
+++ /dev/null
227-
@@ -1,61 +0,0 @@
228-
-name: Tests
229-
-
230-
-on: [push, workflow_dispatch]
231-
-
232-
-permissions: {}
233-
-jobs:
234-
- runPush:
235-
- permissions:
236-
- contents: write # for Update bundles
237-
-
238-
- runs-on: ubuntu-latest
239-
-
240-
- steps:
241-
- - uses: actions/checkout@v2
242-
- - name: Trigger BE build
243-
- if: ${{ github.repository == 'Anuken/Mindustry' }}
244-
- run: |
245-
- git clone --depth=1 --branch=master https://github.com/Anuken/MindustryBuilds ../MindustryBuilds
246-
- cd ../MindustryBuilds
247-
- BNUM=$(($GITHUB_RUN_NUMBER + 20000))
248-
- git tag ${BNUM}
249-
- git config --global user.name "Github Actions"
250-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryBuilds ${BNUM}
251-
- - name: Set up JDK 17
252-
- uses: actions/setup-java@v1
253-
- with:
254-
- java-version: 17
255-
- - name: Setup Gradle
256-
- uses: gradle/gradle-build-action@v2
257-
- - name: Update bundles
258-
- if: ${{ github.repository == 'Anuken/Mindustry' }}
259-
- run: |
260-
- ./gradlew updateBundles
261-
-
262-
- if [ -n "$(git status --porcelain)" ]; then
263-
- git config --global user.name "Github Actions"
264-
- git config --global user.email "[email protected]"
265-
- git add core/assets/bundles/*
266-
- git commit -m "Automatic bundle update"
267-
- git push
268-
- fi
269-
- - name: Update JITpack repo
270-
- if: ${{ github.repository == 'Anuken/Mindustry' }}
271-
- run: |
272-
- git config --global user.name "Github Actions"
273-
- git config --global user.email "[email protected]"
274-
- cd ../
275-
- cp -r ./Mindustry ./MindustryJitpack
276-
- cd MindustryJitpack
277-
- git clone --depth 1 https://github.com/Anuken/MindustryJitpack.git
278-
- rm -rf .git
279-
- cp -r ./MindustryJitpack/.git ./.git
280-
- rm -rf MindustryJitpack
281-
- rm -rf .github
282-
- rm README.md
283-
- git add .
284-
- git commit --allow-empty -m "Updating"
285-
- git push https://Anuken:${{ secrets.API_TOKEN_GITHUB }}@github.com/Anuken/MindustryJitpack
286-
- cd ../Mindustry
287-
- - name: Run unit tests
288-
- run: ./gradlew tests:test --rerun --stacktrace

0 commit comments

Comments
 (0)