Skip to content

Commit ba8976d

Browse files
committed
build: upgrade unity to support NDK23+
1 parent f7d125f commit ba8976d

File tree

11 files changed

+131
-48
lines changed

11 files changed

+131
-48
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ body:
2424
id: unity_version
2525
attributes:
2626
label: Unity Version
27-
placeholder: 6000.0.33f1
27+
placeholder: 6000.0.58f2
2828
validations:
2929
required: true
3030

.github/ISSUE_TEMPLATE/build-install-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ body:
2424
id: unity_version
2525
attributes:
2626
label: Unity Version
27-
placeholder: 6000.0.33f1
27+
placeholder: 6000.0.58f2
2828
validations:
2929
required: true
3030

.github/ISSUE_TEMPLATE/support.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ body:
2525
id: unity_version
2626
attributes:
2727
label: Unity Version
28-
placeholder: 6000.0.33f1
28+
placeholder: 6000.0.58f2
2929
validations:
3030
required: true
3131

.github/workflows/linux-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ jobs:
106106
os:
107107
- ubuntu-24.04
108108
unityVersion:
109-
- 6000.0.33f1
110-
- 2022.3.55f1
109+
- 6000.0.33f1 # FIXME: use >= 6000.0.58f2
110+
- 2022.3.55f1 # FIXME: use >= 2022.3.62f2
111111
steps:
112112
- name: Install UnityEditor
113113
run: |

.github/workflows/macos-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ jobs:
9898
os:
9999
- macos-13
100100
unity:
101-
- { version: "6000.0.33f1", changeset: "433b0a79340b" }
102-
- { version: "2022.3.55f1", changeset: "9f374180d209" }
101+
- { version: "6000.0.33f1", changeset: "433b0a79340b" } # FIXME: use >= 6000.0.58f2
102+
- { version: "2022.3.55f1", changeset: "9f374180d209" } # FIXME: use >= 2022.3.62f2
103103
steps:
104104
- name: Install UnityEditor
105105
run: |

.github/workflows/package.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ jobs:
218218
- name: Install UnityEditor
219219
if: ${{ env.BUILD_UNITYPACKAGE == '1' }}
220220
run: |
221+
# FIXME: use >= 6000.0.58f2
221222
sudo docker cp $(docker create --rm unityci/editor:6000.0.33f1-base-3):/opt/unity /opt/unity
222223
sudo chown -R $(id -u):$(id -g) /opt/unity
223224

.github/workflows/windows-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ jobs:
9292
os:
9393
- windows-2022
9494
unity:
95-
- { version: "6000.0.33f1", changeset: "433b0a79340b" }
96-
- { version: "2022.3.55f1", changeset: "9f374180d209" }
95+
- { version: "6000.0.33f1", changeset: "433b0a79340b" } # FIXME: use >= 6000.0.58f2
96+
- { version: "2022.3.55f1", changeset: "9f374180d209" } # FIXME: use >= 2022.3.62f2
9797
steps:
9898
- name: Install UnityHub
9999
uses: crazy-max/ghaction-chocolatey@v3

Assets/Plugins/Android/mainTemplate.gradle

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,83 @@ android {
4242
}**PACKAGING**
4343

4444
// Include libc++_shared.so
45-
task copyLibcppShared(type: Copy) {
46-
def ndkDir = android.ndkDirectory
47-
from("$ndkDir/sources/cxx-stl/llvm-libc++/libs") { include '**/libc++_shared.so' }
48-
into("$projectDir/src/main/jniLibs")
45+
task copyLibcppShared {
46+
doLast {
47+
def ndkDir = android.ndkDirectory
48+
def abiFilters = android.defaultConfig.ndk.abiFilters
49+
def destDir = file("$projectDir/src/main/jniLibs")
50+
51+
// Mapping from ABI to architecture triple (for NDK 23+)
52+
def abiToTriple = [
53+
'arm64-v8a': 'aarch64-linux-android',
54+
'armeabi-v7a': 'arm-linux-androideabi',
55+
'x86': 'i686-linux-android',
56+
'x86_64': 'x86_64-linux-android',
57+
'riscv64': 'riscv64-linux-android'
58+
]
59+
60+
// Find the prebuilt directory (usually there's only one)
61+
def prebuiltDir = null
62+
def prebuiltBase = file("$ndkDir/toolchains/llvm/prebuilt")
63+
if (prebuiltBase.exists()) {
64+
def prebuiltDirs = prebuiltBase.listFiles()?.findAll { it.isDirectory() }
65+
if (prebuiltDirs && prebuiltDirs.size() > 0) {
66+
prebuiltDir = prebuiltDirs[0]
67+
}
68+
}
69+
70+
abiFilters.each { abi ->
71+
def copied = false
72+
73+
// Try NDK 23+ path first
74+
if (prebuiltDir != null) {
75+
def triple = abiToTriple[abi]
76+
if (triple != null) {
77+
def libcppPath = file("$prebuiltDir/sysroot/usr/lib/$triple/libc++_shared.so")
78+
if (libcppPath.exists()) {
79+
def destAbiDir = file("$destDir/$abi")
80+
copy {
81+
from libcppPath
82+
into destAbiDir
83+
}
84+
copied = true
85+
}
86+
}
87+
}
88+
89+
// Fallback to old NDK path (NDK 22 and earlier)
90+
if (!copied) {
91+
def libcppPath = file("$ndkDir/sources/cxx-stl/llvm-libc++/libs/$abi/libc++_shared.so")
92+
if (libcppPath.exists()) {
93+
def destAbiDir = file("$destDir/$abi")
94+
copy {
95+
from libcppPath
96+
into destAbiDir
97+
}
98+
copied = true
99+
}
100+
}
101+
102+
if (!copied) {
103+
logger.warn("Could not find libc++_shared.so for $abi in NDK")
104+
}
105+
}
106+
}
107+
}
108+
109+
task cleanCopyLibcppShared {
110+
doLast {
111+
def destDir = file("$projectDir/src/main/jniLibs")
112+
def abiFilters = android.defaultConfig.ndk.abiFilters
113+
114+
abiFilters.each { abi ->
115+
def libcppFile = file("$destDir/$abi/libc++_shared.so")
116+
if (libcppFile.exists()) {
117+
libcppFile.delete()
118+
println "Deleted libc++_shared.so for $abi"
119+
}
120+
}
121+
}
49122
}
50123
clean.dependsOn 'cleanCopyLibcppShared'
51124

Packages/manifest.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"dependencies": {
3-
"com.unity.2d.animation": "10.1.4",
3+
"com.unity.2d.animation": "10.2.1",
44
"com.unity.2d.pixel-perfect": "5.0.3",
5-
"com.unity.2d.psdimporter": "9.0.3",
5+
"com.unity.2d.psdimporter": "9.1.0",
66
"com.unity.2d.sprite": "1.0.0",
77
"com.unity.2d.spriteshape": "10.0.7",
88
"com.unity.2d.tilemap": "1.0.0",
9-
"com.unity.ai.navigation": "2.0.5",
10-
"com.unity.collab-proxy": "2.6.0",
11-
"com.unity.ide.rider": "3.0.31",
12-
"com.unity.ide.visualstudio": "2.0.22",
9+
"com.unity.ai.navigation": "2.0.9",
10+
"com.unity.collab-proxy": "2.9.3",
11+
"com.unity.ide.rider": "3.0.38",
12+
"com.unity.ide.visualstudio": "2.0.23",
1313
"com.unity.mathematics": "1.3.2",
14-
"com.unity.memoryprofiler": "1.1.1",
14+
"com.unity.memoryprofiler": "1.1.8",
1515
"com.unity.multiplayer.center": "1.0.0",
16-
"com.unity.settings-manager": "2.0.1",
17-
"com.unity.test-framework": "1.4.5",
16+
"com.unity.settings-manager": "2.1.0",
17+
"com.unity.test-framework": "1.5.1",
1818
"com.unity.testtools.codecoverage": "1.2.6",
19-
"com.unity.timeline": "1.8.7",
19+
"com.unity.timeline": "1.8.9",
2020
"com.unity.toolchain.linux-x86_64": "2.0.10",
2121
"com.unity.toolchain.macos-x86_64-linux-x86_64": "2.0.10",
2222
"com.unity.ugui": "2.0.0",

Packages/packages-lock.json

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
}
1111
},
1212
"com.unity.2d.animation": {
13-
"version": "10.1.4",
13+
"version": "10.2.1",
1414
"depth": 0,
1515
"source": "registry",
1616
"dependencies": {
17-
"com.unity.2d.common": "9.0.7",
17+
"com.unity.2d.common": "9.1.1",
1818
"com.unity.2d.sprite": "1.0.0",
1919
"com.unity.collections": "1.2.4",
2020
"com.unity.modules.animation": "1.0.0",
@@ -23,7 +23,7 @@
2323
"url": "https://packages.unity.com"
2424
},
2525
"com.unity.2d.common": {
26-
"version": "9.0.7",
26+
"version": "9.1.1",
2727
"depth": 1,
2828
"source": "registry",
2929
"dependencies": {
@@ -43,11 +43,11 @@
4343
"url": "https://packages.unity.com"
4444
},
4545
"com.unity.2d.psdimporter": {
46-
"version": "9.0.3",
46+
"version": "9.1.0",
4747
"depth": 0,
4848
"source": "registry",
4949
"dependencies": {
50-
"com.unity.2d.common": "9.0.4",
50+
"com.unity.2d.common": "9.1.1",
5151
"com.unity.2d.sprite": "1.0.0"
5252
},
5353
"url": "https://packages.unity.com"
@@ -79,7 +79,7 @@
7979
}
8080
},
8181
"com.unity.ai.navigation": {
82-
"version": "2.0.5",
82+
"version": "2.0.9",
8383
"depth": 0,
8484
"source": "registry",
8585
"dependencies": {
@@ -88,8 +88,8 @@
8888
"url": "https://packages.unity.com"
8989
},
9090
"com.unity.burst": {
91-
"version": "1.8.18",
92-
"depth": 2,
91+
"version": "1.8.24",
92+
"depth": 1,
9393
"source": "registry",
9494
"dependencies": {
9595
"com.unity.mathematics": "1.2.1",
@@ -98,7 +98,7 @@
9898
"url": "https://packages.unity.com"
9999
},
100100
"com.unity.collab-proxy": {
101-
"version": "2.6.0",
101+
"version": "2.9.3",
102102
"depth": 0,
103103
"source": "registry",
104104
"dependencies": {},
@@ -126,12 +126,11 @@
126126
"com.unity.ext.nunit": {
127127
"version": "2.0.5",
128128
"depth": 1,
129-
"source": "registry",
130-
"dependencies": {},
131-
"url": "https://packages.unity.com"
129+
"source": "builtin",
130+
"dependencies": {}
132131
},
133132
"com.unity.ide.rider": {
134-
"version": "3.0.31",
133+
"version": "3.0.38",
135134
"depth": 0,
136135
"source": "registry",
137136
"dependencies": {
@@ -140,7 +139,7 @@
140139
"url": "https://packages.unity.com"
141140
},
142141
"com.unity.ide.visualstudio": {
143-
"version": "2.0.22",
142+
"version": "2.0.23",
144143
"depth": 0,
145144
"source": "registry",
146145
"dependencies": {
@@ -156,10 +155,14 @@
156155
"url": "https://packages.unity.com"
157156
},
158157
"com.unity.memoryprofiler": {
159-
"version": "1.1.1",
158+
"version": "1.1.8",
160159
"depth": 0,
161160
"source": "registry",
162161
"dependencies": {
162+
"com.unity.burst": "1.8.0",
163+
"com.unity.collections": "1.2.3",
164+
"com.unity.mathematics": "1.2.1",
165+
"com.unity.profiling.core": "1.0.0",
163166
"com.unity.editorcoroutines": "1.0.0"
164167
},
165168
"url": "https://packages.unity.com"
@@ -179,8 +182,15 @@
179182
"dependencies": {},
180183
"url": "https://packages.unity.com"
181184
},
185+
"com.unity.profiling.core": {
186+
"version": "1.0.2",
187+
"depth": 1,
188+
"source": "registry",
189+
"dependencies": {},
190+
"url": "https://packages.unity.com"
191+
},
182192
"com.unity.settings-manager": {
183-
"version": "2.0.1",
193+
"version": "2.1.0",
184194
"depth": 0,
185195
"source": "registry",
186196
"dependencies": {},
@@ -203,22 +213,21 @@
203213
"url": "https://packages.unity.com"
204214
},
205215
"com.unity.test-framework": {
206-
"version": "1.4.5",
216+
"version": "1.5.1",
207217
"depth": 0,
208-
"source": "registry",
218+
"source": "builtin",
209219
"dependencies": {
210220
"com.unity.ext.nunit": "2.0.3",
211221
"com.unity.modules.imgui": "1.0.0",
212222
"com.unity.modules.jsonserialize": "1.0.0"
213-
},
214-
"url": "https://packages.unity.com"
223+
}
215224
},
216225
"com.unity.test-framework.performance": {
217-
"version": "3.0.3",
226+
"version": "3.1.0",
218227
"depth": 2,
219228
"source": "registry",
220229
"dependencies": {
221-
"com.unity.test-framework": "1.1.31",
230+
"com.unity.test-framework": "1.1.33",
222231
"com.unity.modules.jsonserialize": "1.0.0"
223232
},
224233
"url": "https://packages.unity.com"
@@ -234,7 +243,7 @@
234243
"url": "https://packages.unity.com"
235244
},
236245
"com.unity.timeline": {
237-
"version": "1.8.7",
246+
"version": "1.8.9",
238247
"depth": 0,
239248
"source": "registry",
240249
"dependencies": {

0 commit comments

Comments
 (0)