Commit Graph

5762 Commits

Author SHA1 Message Date
Ben Liblit 17fc048599 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>.
2018-04-18 11:29:28 -05:00
Ben Liblit c6a6ef8b97 Minor indentation fix 2018-04-18 11:29:28 -05:00
Ben Liblit bcbd298808 Extra help for finding "cast" native library on macOS
Unlike Linux, macOS has no "RPATH" facility for embedding additional
search paths within shared libraries.  Instead, we need to set
"DYLD_LIBRARY_PATH" appropriately in the environment.  This
environment variable is the macOS analogue of "LD_LIBRARY_PATH" on
Linux.

Note that adding the required path to the "java.library.path" system
property will *not* work.  This property only affects where the JVM
looks for shared objects that it is loading directly.  This property
does not influence the search for other, transitively-required shared
objects.

Fixes #3.
2018-04-18 11:29:28 -05:00
Ben Liblit 48ffce525c Fix remaining Javadoc warnings
This fixes the last of our Javadoc warnings without creating a
circular dependency between ":com.ibm.wala.cast:javadoc" and
":com.ibm.wala.cast.js:javadoc".  Fixes #4, wherein more details about
this tricky dependency challenge can be found.
2018-04-18 11:29:28 -05:00
Ben Liblit 2a75244914 Use ".singleFile" instead of "[0]" when we expect just one file
This documents our intent more clearly, and actively checks for
mistakes rather than silently ignoring unexpected extra files.
2018-04-18 11:29:28 -05:00
Ben Liblit 1d8869bb0a Start exploring publication features by adding source jar archives 2018-04-18 11:29:28 -05:00
Ben Liblit 7fd8f02382 Replicate test include/exclude patterns already used in Maven builds 2018-04-18 11:29:28 -05:00
Ben Liblit 9a2af5bbb8 Add "com.ibm.wala.core.testdata" to classpath for testing
This lets the "DynamicCallGraphTest" tests pass.  The tests in that
class expect to find some element of the classpath that includes the
substring "com.ibm.wala.core.testdata".  They then treat that as a
collection of bytecode files to instrument.
2018-04-18 11:29:28 -05:00
Ben Liblit 4c179e51bc Skip a test intentionally; Maven already does the same
Big thanks to Julian for showing me where this exclusion logic lives
in the Maven configuration.  There's a "**/*AndroidLibs*.java"
exclusion pattern in the top-level "pom.xml".
2018-04-18 11:29:28 -05:00
Ben Liblit fca0f7c117 Fix jar exclusion patterns to match what Ant uses
One previously-failing test class now passes.  Progress!
2018-04-18 11:29:28 -05:00
Ben Liblit c2b1930248 Add some Eclipse dependencies needed only when running tests
This allows two test classes to pass that previously were failing.
Yay!
2018-04-18 11:29:28 -05:00
Ben Liblit bb98b2f84d Add a resource directory containing a zip archive used for testing
The excluded test in this subproject still does not pass, though now
it's failing for a different reason than before.  Progress, I suppose!
2018-04-18 11:29:28 -05:00
Ben Liblit 20be2b59c4 Disable Gradle linter check for unused dependencies in Travis CI
It's telling me to remove "eclipse-deps:org.eclipse.core.runtime:+"
and "org.osgi:org.osgi.core:4.2.0" as unused dependencies in the
"com.ibm.wala.cast.java.ecj" subproject.  However, these two
dependencies (jar files) are actually needed; compilation fails
without them.
2018-04-18 11:29:28 -05:00
Ben Liblit d0bf53474b Also get Eclipse JSDT from a P2 repository, but not the same one 2018-04-18 11:29:28 -05:00
Ben Liblit c16f172932 Find Eclipse jars using local Maven mirror of Eclipse P2 repository
This should give us a set of mutually-consistent jars rather than
picking up random, outdated pieces from Maven Central or wherever else
I could find them.  We now also have a single, central place where we
set the Eclipse version that we're building against.  Much, *much*
cleaner.
2018-04-18 11:29:28 -05:00
Ben Liblit fc0b951ead Assume that Eclipse needs all standard test-resource processing 2018-04-18 11:29:28 -05:00
Ben Liblit a99db6b946 Trivial whitespace tweak 2018-04-18 11:29:28 -05:00
Ben Liblit 01e54886df Exclude one macOS test that I don't know how to fix right now 2018-04-18 11:29:28 -05:00
Ben Liblit 3d026d409e Download appropriate Android SDK for current OS 2018-04-18 11:29:28 -05:00
Ben Liblit baee9d32e1 Try to continue building/testing even after the first failure
If other, non-dependent tasks would also fail, I'd rather discover all
of them at once.
2018-04-18 11:29:28 -05:00
Ben Liblit d8948324f7 "rm" on macOS apparently doesn't understand long ("--foo") flags 2018-04-18 11:29:28 -05:00
Ben Liblit 393ef13622 macOS doesn't seem to have "xvfb-run", and may not need it anyway 2018-04-18 11:29:28 -05:00
Ben Liblit b5cfd56041 Enable macOS (a.k.a. OS X) Travis CI testing for Gradle builds
We're not going to attempt macOS Travis CI testing for Maven builds,
because I don't know whether that's even expected to work on the
official WALA master branch.  Our main focus here is Gradle.

Note that Travis macOS images do not support JDK switching, so
explicitly selecting the JDK version now becomes part of the
Linux-only configuration.

Travis macOS images also do not support Android as a build "language".
So our Travis CI configuration for Gradle builds now declares that
this is a Java project rather than an Android one.  That's OK, though,
because our Gradle scripts already handle downloading the Android SDK;
we don't need Travis CI to do that for us.  When building using Maven,
though, we still call this an Android project because Maven builds do
still rely on Travis CI to provide the Android SDK.

squash! Enable macOS (a.k.a. OS X) Travis CI testing for Gradle builds
2018-04-18 11:29:27 -05:00
Ben Liblit 4853d2b275 Download a specific DroidBench release that we know works for us
If future DroidBench changes include things we need, then we can
decide to move to those newer revisions.  But we shouldn't allow
DroidBench to change out from under us implicitly whenever someone
commits something new to the DroidBench repository.
2018-04-18 11:29:27 -05:00
Ben Liblit c223625f22 Add "TODO" reminders of furture refactoring opportunities 2018-04-18 11:29:27 -05:00
Ben Liblit af5a22d4bb Factor out some repeated accesses to a task's output files 2018-04-18 11:29:27 -05:00
Ben Liblit 1cf1d7c05a Derive Android platforms version from Android build-tools version
This should help us keep the two in sync if the latter changes one
day.
2018-04-18 11:29:27 -05:00
Ben Liblit dfe3659dcb Got DynamicDalvikComparisonJavaLibsTest working at some point 2018-04-18 11:29:27 -05:00
Ben Liblit bbc9ec7e97 Ignore a transient file that appears during testing 2018-04-18 11:29:27 -05:00
Ben Liblit eb00a84a40 Grab an additional archive needed by DalvikAnnotationsTest 2018-04-18 11:29:27 -05:00
Ben Liblit 22245f8cb4 Download a few additional supporting files needed by tests 2018-04-18 11:29:27 -05:00
Ben Liblit 79c8cf1411 Import a class that we will soon be using multiple times 2018-04-18 11:29:27 -05:00
Ben Liblit 2e04ac9838 Fix accidental copying of entire subproject as test resource 2018-04-18 11:29:27 -05:00
Ben Liblit 90a947dad1 Use an "android.jar" that matches the "dx.jar" we are already using
Nothing was obviously failing with the older "android.jar", but I feel
more comfortable knowing that these two are more closely matched.
2018-04-18 11:29:27 -05:00
Ben Liblit fde718b5d3 Suppress harmless broken-pipe warnings from "yes" 2018-04-18 11:29:27 -05:00
Ben Liblit 386cdc117b Set Android build-tools version in just one place 2018-04-18 11:29:27 -05:00
Ben Liblit bc0062e4b0 Use more recent "dx.jar" than is available through Maven Central
This lets us ditch pre-Java-8 in the Gradle build.  (The official WALA
master branch recently got rid of pre-Java-8 in its Maven build.)
That, in turn, lets two "com.ibm.wala.dalvik.test" tests pass that
previously were failing.  We still have two other failing tests in
that subproject, but this is definitely progress!

Our Gradle build scripts manage the entire process of downloading and
locally installing the appropriate Android SDK.  That includes
automatically accepting a license.  Maybe some lawyer will throw a fit
about that some day.  Until then, I'd rather have a build system that
does everything needed without imposing additional manual steps on
developers.
2018-04-18 11:29:27 -05:00
Ben Liblit a09be64332 Ignore some transient files that appear during testing 2018-04-18 11:29:27 -05:00
Ben Liblit 77e0fc2b9c Set name and version to help Gradle composite-build substitutions 2018-04-18 11:29:27 -05:00
Ben Liblit 5398570308 Update Eclipse JUnit test launchers for use with Buildship
Previously Buildship removed its classpath from all of these
launchers.  Now it's automatically putting that back in as soon as I
visit each launcher in Eclipse's "Run Configurations" dialog.  Not
sure what's going on here, but it certainly seems more sane to me to
assume that the Buildship-computed classpath *is* needed for all of
these.  I have an open question on the Gradle discussion forum to try
to understand what's going on here and how to fix it:
<https://discuss.gradle.org/t/launchers-lose-buildship-classpath-on-import-regain-it-later/25641>.
2018-04-18 11:29:27 -05:00
Ben Liblit 525c4aa5fe Update Eclipse "Java Application" launchers for use with Buildship 2018-04-18 11:29:27 -05:00
Ben Liblit c2edaf3119 Use Eclipse-computed paths rather than hard-coding absolute paths 2018-04-18 11:29:27 -05:00
Ben Liblit ca17b12187 Remove launchers whose main Java code is found nowhere in WALA 2018-04-18 11:29:27 -05:00
Ben Liblit f6db318c91 Note some excessive resource copying that we should eventually fix 2018-04-18 11:29:27 -05:00
Ben Liblit 39781604a2 Create a broad "Process Test Resources" Eclipse launch configuration
This should prepare test resources for all subprojects.  A WALA
developer should run this once before running any tests inside
Eclipse.  Initially I'd hoped to make this more narrowly focused, but
Eclipse just doesn't have the infrastructure to deal with fine-grained
dependencies.  On the other hand, running "./gradlew
eclipsePrepareTestResources" automatically for each build seems like
overkill, and could end up being rather slow.  So for now we require
that the developer run this once, by hand.
2018-04-18 11:29:27 -05:00
Ben Liblit 61d8ee1b02 Fix various warnings produced by "./gradlew javadoc"
Three stubborn warnings remain, but this is progress!
2018-04-18 11:29:27 -05:00
Ben Liblit eb4e97a665 Fix warnings about Javadoc links to "java.lang.reflect" package 2018-04-18 11:29:27 -05:00
Ben Liblit da90d1cf5a Trigger custom clean tasks whenever running "./gradlew clean"
A cleaned tree is now much closer to a pristine tree that has just
been checked out and never built.  The only extra created files that
are left behind are ".gradle", "buildSrc/.gradle", and
"buildSrc/build".
2018-04-18 11:29:27 -05:00
Ben Liblit 51cef18bc9 Unpack node.js in the same place that Maven unpacks it
This gets rid of some Eclipse warnings that stem from Buildship being
confused about what it should treat as a source directory if Maven and
Gradle are both being used in the same tree.
2018-04-18 11:29:27 -05:00
Ben Liblit b3dab4c2b0 Tweak Buildship-generated Eclipse ".project" file for extra jars 2018-04-18 11:29:27 -05:00