Skip to content

Commit

Permalink
Merge pull request #881 from JetBrains/feature/fix-jna-path
Browse files Browse the repository at this point in the history
Fix JNA library path in tests
  • Loading branch information
sergej-koscejev authored Jul 3, 2024
2 parents 3c5cfa9 + eb32893 commit d035a45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 215 deletions.
193 changes: 0 additions & 193 deletions build.allScripts/build.xml

This file was deleted.

26 changes: 4 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ ext.extensions_home = '-Dextensions.home=' + rootDir

// ___________________ utilities ___________________
File scriptFile(String relativePath) {
new File("$rootDir/build/patched/$relativePath")
new File("$rootDir/build/generated/$relativePath")
}

def defaultScriptArgs = [mps_home, build_dir, artifacts_dir, ext.buildDate, ext.pluginVersion]
def defaultScriptArgs = [mps_home, build_dir, artifacts_dir, ext.buildDate, ext.pluginVersion,
'-Dbuild.jna.library.path=' + new File(mpsHomeDir, 'lib/jna/' + System.getProperty('os.arch'))]

afterEvaluate {
project.ext["itemis.mps.gradle.ant.defaultJavaExecutable"] = tasks.getByName('downloadJbr').javaExecutable
Expand Down Expand Up @@ -251,30 +252,11 @@ task resolved_diagram_dependencies(type: Copy) {
}
}

def build_allScripts_unpatched = tasks.register('build_allScripts_unpatched', BuildLanguages) {
tasks.register('build_allScripts', BuildLanguages) {
dependsOn 'downloadJbr', resolveMps, copyModelApi, resolved_diagram_dependencies
script "$rootDir/scripts/build.xml"
}

// Patch JNA path in generated build scripts until https://github.com/JetBrains/MPS/pull/71 is fixed
def patch_allScripts = tasks.register('patch_allScripts', Copy) {
dependsOn build_allScripts_unpatched
from 'build/generated'
into 'build/patched'

def isAarch64 = System.getProperty('os.arch') == 'aarch64'
def jnaArch = isAarch64 ? 'aarch64' : 'amd64'

filter {
it.replace('"-Djna.boot.library.path=${artifacts.mps}/lib/jna"',
'"-Djna.boot.library.path=${artifacts.mps}/lib/jna/' + jnaArch + '"')
}
}

task build_allScripts {
dependsOn patch_allScripts
}

task copyChangelog(type: Copy) {
from "$rootDir/code/solutions/de.itemis.mps.extensions.changelog/source_gen/de/itemis/mps/extensions/changelog"
into "$rootDir"
Expand Down

0 comments on commit d035a45

Please sign in to comment.