Browse Source

Generalize post-import Eclipse run configuration for more fixups

Previously this launcher's job was to run "processTestResources" and
any other Gradle tasks needed to create files that Eclipse was
expecting to be available.  But we also want to use it to revert the
bad changes that Buildship applies to ".launch" configuration files.

This is a temporary hack to work around
<https://github.com/eclipse/buildship/issues/653>.
master
Ben Liblit 5 years ago
parent
commit
17fc048599
  1. 2
      After Importing WALA Into Eclipse.launch
  2. 8
      build.gradle
  3. 2
      com.ibm.wala.core.testdata/build.gradle
  4. 19
      revert-launchers.sh

2
Process Test Resources.launch → After Importing WALA Into Eclipse.launch

@ -13,7 +13,7 @@
<booleanAttribute key="show_console_view" value="true"/>
<booleanAttribute key="show_execution_view" value="true"/>
<listAttribute key="tasks">
<listEntry value="eclipseProcessTestResources"/>
<listEntry value="afterEclipseBuildshipImport"/>
</listAttribute>
<stringAttribute key="working_dir" value="${workspace_loc:/com.ibm.wala}"/>
</launchConfiguration>

8
build.gradle

@ -84,9 +84,7 @@ subprojects { subproject ->
}
}
task eclipseProcessTestResources {
dependsOn processTestResources
}
task afterEclipseBuildshipImport(dependsOn: processTestResources)
test {
include '**/*Test.class'
@ -97,6 +95,10 @@ subprojects { subproject ->
}
}
task afterEclipseBuildshipImport(type: Exec) {
commandLine './revert-launchers.sh'
}
////////////////////////////////////////////////////////////////////////
//

2
com.ibm.wala.core.testdata/build.gradle vendored

@ -186,7 +186,7 @@ task cleanColllectTestDataA(type: Delete) {
// help Eclipse build these extra jars when needed
//
eclipseProcessTestResources {
afterEclipseBuildshipImport {
dependsOn(
collectJLex,
collectTestData,

19
revert-launchers.sh

@ -0,0 +1,19 @@
#!/bin/bash -eu
cd "$(dirname "$0")"
# be selective; revert only launchers we think we know about
launchers=(com.ibm.wala.*/launchers/*.launch com.ibm.wala.*/.launchConfigurations/*.launch)
# if no launchers have changed, then there's nothing for us to do
if git diff --quiet "${launchers[@]}"; then
exit
fi
# create a backup in case we revert something that we should have left alone
git stash save --quiet 'safety snapshot before reverting launcher changes made by Eclipse Buildship import'
git stash apply --quiet
# revert launch configurations that Buildship import has mangled
# <https://github.com/eclipse/buildship/issues/653>
git checkout -- "${launchers[@]}"
Loading…
Cancel
Save