@@ -159,53 +159,76 @@ tasks.withType(RunAntScript).configureEach {
159
159
dependsOn(configureJava, resolveMps)
160
160
}
161
161
162
- task build_allScripts ( type : BuildLanguages , dependsOn : [resolveMps, configureJava] ) {
162
+ def build_allScripts_unpatched = tasks . register( ' build_allScripts_unpatched ' , BuildLanguages ) {
163
163
script " $buildDir /scripts/build_all_scripts.xml"
164
164
}
165
165
166
+ // Patch JNA path in generated build scripts until https://github.com/JetBrains/MPS/pull/71 is fixed
167
+ def patch_allScripts = tasks. register(' patch_allScripts' , Copy ) {
168
+ dependsOn build_allScripts_unpatched
169
+ from ' build/scripts'
170
+ into ' build/patched-scripts'
171
+
172
+ def isAarch64 = System . getProperty(' os.arch' ) == ' aarch64'
173
+ def jnaArch = isAarch64 ? ' aarch64' : ' amd64'
174
+
175
+ filter {
176
+ it. replace(' "-Djna.boot.library.path=${artifacts.mps}/lib/jna"' ,
177
+ ' "-Djna.boot.library.path=${artifacts.mps}/lib/jna/' + jnaArch + ' "' )
178
+ }
179
+ }
180
+
181
+ task build_allScripts {
182
+ dependsOn patch_allScripts
183
+ }
184
+
185
+ File scriptFile (String name ) {
186
+ file(" $buildDir /patched-scripts/$name " )
187
+ }
188
+
166
189
// All other MPS tasks depend on build_allScripts
167
190
tasks. withType(RunAntScript ). configureEach {
168
- if (it != build_allScripts ) {
191
+ if (it. name != build_allScripts_unpatched . name ) {
169
192
it. dependsOn(build_allScripts)
170
193
}
171
194
}
172
195
173
196
task build_base_languages (type : BuildLanguages ) {
174
- script " $b uildDir /scripts/ build-base-languages.xml"
197
+ script scriptFile( ' build-base-languages.xml' )
175
198
}
176
199
177
200
task build_testing_languages (type : BuildLanguages , dependsOn : [build_base_languages]) {
178
- script " $b uildDir /scripts/ build-testing-languages.xml"
201
+ script scriptFile( ' build-testing-languages.xml' )
179
202
}
180
203
181
204
task test_testing (type : TestLanguages , dependsOn : [build_testing_languages]) {
182
205
// MPS build language generator is confused about the basedir of the generated script so we set it manually
183
206
scriptArgs = [" -Dbasedir=${ file('code/languages/org.mpsqa.testing')} " ]
184
- script " $b uildDir /scripts/ test-testing.xml"
207
+ script scriptFile( " test-testing.xml" )
185
208
}
186
209
187
210
task build_clones_languages (type : BuildLanguages , dependsOn : [build_base_languages]) {
188
- script " $b uildDir /scripts/ build-clones-languages.xml"
211
+ script scriptFile( " build-clones-languages.xml" )
189
212
}
190
213
191
214
task build_mutant_languages (type : BuildLanguages , dependsOn : []) {
192
- script " $b uildDir /scripts/ build-mutant-languages.xml"
215
+ script scriptFile( " build-mutant-languages.xml" )
193
216
}
194
217
195
218
task build_unused_languages (type : BuildLanguages , dependsOn : []) {
196
- script " $b uildDir /scripts/ build-unused-languages-analysis.xml"
219
+ script scriptFile( " build-unused-languages-analysis.xml" )
197
220
}
198
221
199
222
task build_arch_languages (type : BuildLanguages , dependsOn : []) {
200
- script " $b uildDir /scripts/ build-arch-analysis-languages.xml"
223
+ script scriptFile( " build-arch-analysis-languages.xml" )
201
224
}
202
225
203
226
task build_deprecation_analysis_languages (type : BuildLanguages , dependsOn : []) {
204
- script " $b uildDir /scripts/ build-deprecated-analysis-languages.xml"
227
+ script scriptFile( " build-deprecated-analysis-languages.xml" )
205
228
}
206
229
207
230
task build_lint_analysis_languages (type : BuildLanguages , dependsOn : []) {
208
- script " $b uildDir /scripts/ build-lint-analysis-languages.xml"
231
+ script scriptFile( " build-lint-analysis-languages.xml" )
209
232
}
210
233
211
234
task build_allInOne_package (type : BuildLanguages , dependsOn : [build_allScripts]) {
@@ -217,7 +240,7 @@ task build_allInOne_package(type: BuildLanguages, dependsOn: [build_allScripts])
217
240
dependsOn ' build_arch_languages'
218
241
dependsOn ' build_deprecation_analysis_languages'
219
242
dependsOn ' build_lint_analysis_languages'
220
- script " $b uildDir /scripts/ build-allInOne-package.xml"
243
+ script scriptFile( " build-allInOne-package.xml" )
221
244
}
222
245
223
246
task package_mpsqa (type : Zip , dependsOn : build_allInOne_package) {
@@ -228,12 +251,12 @@ task package_mpsqa(type: Zip, dependsOn: build_allInOne_package) {
228
251
229
252
task test_clones (type : TestLanguages , dependsOn : build_clones_languages) {
230
253
description " Will execute clones tests from command line"
231
- script new File ( " $b uildDir /scripts/ test-clones.xml" )
254
+ script scriptFile( " test-clones.xml" )
232
255
}
233
256
234
257
task test_lint (type : TestLanguages , dependsOn : build_lint_analysis_languages) {
235
258
description " Will execute lint tests from command line"
236
- script " $b uildDir /scripts/ build-lint-tests.xml"
259
+ script scriptFile( " build-lint-tests.xml" )
237
260
}
238
261
239
262
check. dependsOn(tasks. withType(TestLanguages ))
0 commit comments