Commit Graph

233 Commits

Author SHA1 Message Date
Ben Liblit 89860b53bb Let Buildship create new settings files when importing
These settings files currently are generated with an initial timestamp
comment line, which is not something we'd want to track in version
control.  Fortunately, the contents of these files are entirely
mundane, so there should be no problem with having Buildship generate
them anew each time a developer imports WALA into Eclipse as an
existing Gradle project.
2018-04-18 11:29:25 -05:00
Ben Liblit 310ef1daa5 Exclude Eclipse ".project" and ".classpath" from version control
Apparently Buildship generates these when one uses Import -> Existing
Gradle Project:
<https://discuss.gradle.org/t/buildship-eclipse-plug-in-multiproject-builds/24030/5>.
We can use the Gradle "eclipse" plugin if customizations are
necessary, but my impression is that the intent is to treat ".project"
and ".classpath" as generated files, not sources to be tracked in
source control.
2018-04-18 11:29:25 -05:00
Ben Liblit 1432e18c37 Clean up some simple syntactic redundancy in dependency declarations 2018-04-18 11:29:25 -05:00
Ben Liblit 0500d237f9 Add various test resource directories
Unfortunately these tests are still not finding their resources
properly at test run time.  I don't know why.  It seems to have
something to do with how the tests instantiate and use class loaders.
I'm probably going to need expert help with this.
2018-04-18 11:29:25 -05:00
Ben Liblit 5d5fa18b5f Replace source directories rather than appending to them
I was confused about the differences among:

	srcDir 'foo'
	srcDirs ['foo']
	srcDirs = ['foo']

As it turns out, the first two append to the set of source
directories, while the last replaces this set entirely.  I generally
want replacement, since WALA's current directory layout never matches
Gradle's assumed defaults.
2018-04-18 11:29:25 -05:00
Ben Liblit afa982adf2 Properly distinguish main from test code, now that I know how 2018-04-18 11:29:25 -05:00
Ben Liblit 2ef04905c2 Additional explicit dependencies suggested by Gradle linter 2018-04-18 11:29:24 -05:00
Ben Liblit 2716731357 Add Gradle build script for a subproject that previously had none 2018-04-18 11:29:24 -05:00
Ben Liblit 530d74929f Many improvements to Gradle build support, including within Eclipse 2018-04-18 11:29:24 -05:00
Ben Liblit 99c2493e37 Revert "Build WALA using Gradle instead of Maven" (#298) 2018-04-18 12:15:56 -04:00
Ben Liblit 6639d8b93a Bump version to 1.5.0-SNAPSHOT before merging with WALA master
This gives the WALA maintainers the option of doing future 1.4.5+
releases from of a pre-Gradle branch if these merged Gradle changes
turn out to be more disruptive than expected.
2018-04-17 15:32:01 -05:00
Ben Liblit 5df33f85d7 Simplify how we refer to the outputs of certain tasks 2018-04-17 15:02:36 -05:00
Ben Liblit 93c8d126b8 Unpack Android SDK and install extra components as a single task
Previously we unpacked in one task, then installed two extra
components in two dependent tasks.  However, installing extra
components modifies some files in place, effectively making those
files both inputs and outputs.  That creates race conditions, and
probably interferes with task output caching.  Better, then, to treat
the unpack and extra installations all as a single task whose output
is the complete Android SDK tree with all required components
installed.
2018-04-17 15:02:36 -05:00
Ben Liblit 66a4d20e3a Improve build caching by reducing path sensitivity where appropriate 2018-04-17 15:02:36 -05:00
Ben Liblit 6869a4d5f4 Enable caching of task outputs for custom build tasks 2018-04-17 15:02:36 -05:00
Ben Liblit 4f94b4c341 Extend Gradle's "clean" task to remove some additional build targets 2018-04-17 15:02:36 -05:00
Ben Liblit 9d7df5de7e After Builldship import, put "dx.jar" where the manifest expects it 2018-04-17 15:02:36 -05:00
Ben Liblit 0a21f20348 Factor out common code for installing Android SDK components 2018-04-17 15:02:36 -05:00
Ben Liblit ad111547de Skip DroidBench tests on Windows, for now
The default location of DroidBench in "/tmp/DroidBench" does not work
well on Windows. So let's disable these tests until someone has time to
make that path more portable.
2018-04-17 15:02:36 -05:00
Ben Liblit f568db5de6 Fix Android SDK installation under Windows 2018-04-17 15:02:36 -05:00
Ben Liblit 7f8de6d611 Switch to a different DroidBench download URL
This URL skips over a redirect that the previous URL went through.
This URL also avoids an annoying "Invalid cookie header" warning that
the previous URL produced.
2018-04-17 15:02:36 -05:00
Ben Liblit e4f9fedf38 Use download task instead of "git clone" to get DroidBench
This gives us better progress reporting during the download, better
caching, better file-level dependency tracking, etc.
2018-04-17 15:02:36 -05:00
Ben Liblit 813c79caa0 Factor out recurring pattern in download tasks 2018-04-17 15:02:36 -05:00
Ben Liblit ba455f4737 Update gradle-download-plugin and use some of its new features
We now download and verify checksums as a single task, rather than as
two separate tasks.  This simplifies other task dependencies, since we
no longer have a checksum-verified "stamp" file separate from the
download itself.  Unfortunately the combined task now has a
significant amount of repeated boilerplate.  I'm hoping to refactor
that all out into a custom task class, but haven't yet figured out the
details:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.

We now also use ETags to be smarter about when a fresh download is or
is not actually needed.  I think there are still opportunities for
improved caching here, but this is a step in the right direction.
2018-04-17 15:02:36 -05:00
Ben Liblit 709c38c049 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-17 15:02:36 -05:00
Ben Liblit 2bf92e1214 Replicate test include/exclude patterns already used in Maven builds 2018-04-17 15:02:36 -05:00
Ben Liblit b8f1bb3aaf 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-17 15:02:36 -05:00
Ben Liblit e9ea4d7f1d Download appropriate Android SDK for current OS 2018-04-17 15:02:36 -05:00
Ben Liblit 0e231b4363 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-17 15:02:36 -05:00
Ben Liblit 49eda8ffab Add "TODO" reminders of furture refactoring opportunities 2018-04-17 15:02:36 -05:00
Ben Liblit cdd4aac942 Factor out some repeated accesses to a task's output files 2018-04-17 15:02:35 -05:00
Ben Liblit 9b5cc743fe 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-17 15:02:35 -05:00
Ben Liblit 18a4edd84e Got DynamicDalvikComparisonJavaLibsTest working at some point 2018-04-17 15:02:35 -05:00
Ben Liblit ff8f6ec348 Ignore a transient file that appears during testing 2018-04-17 15:02:35 -05:00
Ben Liblit e3ebd87242 Grab an additional archive needed by DalvikAnnotationsTest 2018-04-17 15:02:35 -05:00
Ben Liblit 22acff5130 Download a few additional supporting files needed by tests 2018-04-17 15:02:35 -05:00
Ben Liblit d78d68176e Import a class that we will soon be using multiple times 2018-04-17 15:02:35 -05:00
Ben Liblit e70ddf4dec 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-17 15:02:35 -05:00
Ben Liblit 1a82397fd7 Suppress harmless broken-pipe warnings from "yes" 2018-04-17 15:02:35 -05:00
Ben Liblit bcf685ba40 Set Android build-tools version in just one place 2018-04-17 15:02:35 -05:00
Ben Liblit b2fa87efe3 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-17 15:02:35 -05:00
Ben Liblit 57e3dc15fa 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-17 15:02:35 -05:00
Ben Liblit 2233d56d2a Get a Dalvik test to work by putting "dx.jar" where expected 2018-04-17 15:02:35 -05:00
Ben Liblit cad94b7076 Download "android-4.1.1.4.jar" (as "android.jar") when needed
Previously Maven did this, but Gradle did not.  So Gradle testing
would only succeed if we'd already done a Maven build first.  Now
these tests pass in a fresh tree that's never seen a Maven build.
2018-04-17 15:02:35 -05:00
Ben Liblit b24f60e727 Enable a few more tests that started working, or perhaps always did 2018-04-17 15:02:35 -05:00
Ben Liblit b1f0cfce15 Replicate Maven's heap size limits for tests 2018-04-17 15:02:35 -05:00
Ben Liblit e2e340b490 Explicitly disable regression tests that are currently failing
<https://github.com/liblit/WALA/issues/5> notes that several
subprojects' tests are currently broken under Gradle.  I'd still like
to be able to run non-broken tests, though.  So here I'm disabling the
failing tests.  The intent is to treat these exclusions as a to-do
list.  We can remove exclusions as we get the corresponding tests
working.  No more exclusions means
<https://github.com/liblit/WALA/issues/5> is fixed.
2018-04-17 15:02:35 -05:00
Ben Liblit 6a4ed60e9a Explicitly make "/tmp/DroidBench" be a file, not just a string
I'm hoping this might remove some seemingly-spurious reruns of this
task.  Still not sure why those are happening, though.
2018-04-17 15:02:35 -05:00
Ben Liblit a32a3e3191 Teach Gradle how to download "/tmp/DroidBench" when needed
One less thing for developers to have to remember to do manually!
2018-04-17 15:02:35 -05:00
Ben Liblit 365d17bf32 Simplify how we refer to existing tasks 2018-04-17 15:02:35 -05:00