Commit Graph

285 Commits

Author SHA1 Message Date
Julian Dolby b2503628a4 1) a bit more source mappimg information
2) fixes to how Contexts are combined
2018-10-13 08:42:08 -04:00
Erik Derr ee13713c4d Impl of IMethod.is(Wala)Synthetic and IClass.isSynthetic (#359)
* Impl of IMethod isSynthetic and isWalaSynthetic

So far IMethod.isSynthetic referred to WALA-generated helper functions
and there was no equivalent to check whether an IMethod is synthetic in
terms of compiler-generated.

To make naming consistent this patch first renames the isSynthetic to
isWalaSynthetic to clearly indicate that a given IMethod was generated
by WALA. Then, we re-introduce isSynthetic that from now on checks
whether an IMethod is synthetic/compiler-generated (referring to the
synthetic flag in bytecode)

* Implementation of IClass.isSynthetic

Complementary to IMethod.isSynthetic, this method checks whether
an IClass is compiler-generated.

* updated JavaDoc
2018-10-02 22:28:21 -07:00
Sifis Lagouvardos 6fd67b886e Added multidex apk file in dalvik.test/data and a new test for multidex apk files. 2018-09-21 19:08:06 -07:00
Sifis Lagouvardos 819e7e1a7f Added test for the new DexFileModule constructor that supports specific .dex files. 2018-09-21 19:08:06 -07:00
Manu Sridharan 49628fdf44 Start new development version 2018-08-22 12:01:19 -07:00
Manu Sridharan 6b46ce4faa Version 1.5.0 2018-08-22 11:19:51 -07:00
Ben Liblit 32795455fb Avoid redundant copying of some test resources
These specific test resources are already included in the "testArchives"
configuration of the "com.ibm.wala.core.tests" subproject, upon which
the "com.ibm.wala.dalvik.test" tests already depend.  So there's no need
to also copy these resources into the "com.ibm.wala.dalvik.test" test
resources area as well.
2018-08-11 12:40:44 -05:00
Ben Liblit d9f7abdad3 Augment cleanTest tasks rather than replacing them
Previously I hadn't realized that Gradle's "java" plugin would generate
default "cleanTest" tasks for us.  By defining my own "cleanTest" tasks
we were replacing the generated ones, but what we really wanted to do
was augment them with additional files to delete.
2018-08-11 12:36:22 -05:00
Julian Dolby 0ad11fefc3 work on Wala with Yannis' group 2018-07-22 16:19:32 -04:00
Ben Liblit 1ac4ca9475 Tweaks and instructions for WALA as an IntelliJ IDEA project
We already had some IntelliJ IDEA project metadata files in ".idea".
I've revisited and updated those now that I have more experience with
Gradle + IntelliJ IDEA + Git.  I think this now represents a better
set of decisions regarding what does and does not belong in version
control.

This commit also extends "README-Gradle.md" with clear instructions on
how to bringup WALA as a top-level IntelliJ IDEA project.  The
instructions are of a similar flavor to the Eclipse instructions that
were already present, though the details vary.  Most notably, with
IntelliJ IDEA you should *open* WALA as an existing project,
not *import* it as a new Gradle project derived from "build.gradle".
This is exactly the reverse of what one should and shouldn't do for
WALA in Eclipse.
2018-07-12 14:52:13 -07:00
Ben Liblit 3d9e4d23d8 Add helper task for extra setup after opening in IntelliJ IDEA
This task serves a similar role to the "afterEclipseBuildshipImport"
task used with Eclipse.  It should only be necessary to build this
task once:  in a freshly checked-out tree, just after opening it for
the first time in IntelliJ IDEA.

Ideally this extra setup task would be triggered automatically using
the "Tasks Activation" feature of IntelliJ IDEA's Gradle support.
Unfortunately, "Tasks Activation" settings are recorded in
".idea/workspace.xml", which is used for non-revision-tracked personal
settings.
2018-07-11 15:13:39 -05:00
Ben Liblit decd164fa6 Require JUnit 4.12 instead of 4.11
WALA itself does not use any JUnit 4.12 features.  However, I am
working on a WALA-based project that does require JUnit 4.12.  Mixing
jar versions is a path to madness.  So if the WALA maintainers don't
mind, it would make my life easier if WALA itself required JUnit 4.12.
Otherwise, I need to maintain that 4.11/4.12 difference indefinitely
as a divergence between official WALA and my WALA variant.

I suppose an alternative could be to let the JUnit version be
specified externally somehow. I have not explored this option in
depth, but could look into it if simply moving to JUnit 4.12 is
undesirable.
2018-05-21 17:27:54 -05:00
Ben Liblit 209086f068 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-18 11:29:29 -05:00
Ben Liblit 7cbccb33fb Simplify how we refer to the outputs of certain tasks 2018-04-18 11:29:29 -05:00
Ben Liblit 47539da731 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-18 11:29:29 -05:00
Ben Liblit 36fe02d71c Improve build caching by reducing path sensitivity where appropriate 2018-04-18 11:29:29 -05:00
Ben Liblit 74523f5058 Enable caching of task outputs for custom build tasks 2018-04-18 11:29:29 -05:00
Ben Liblit c0ec959e4a Extend Gradle's "clean" task to remove some additional build targets 2018-04-18 11:29:29 -05:00
Ben Liblit 7dcff25dcf After Builldship import, put "dx.jar" where the manifest expects it 2018-04-18 11:29:29 -05:00
Ben Liblit 5f2d64f85a Factor out common code for installing Android SDK components 2018-04-18 11:29:28 -05:00
Ben Liblit 587d0a95dc 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-18 11:29:28 -05:00
Ben Liblit c642ec4039 Fix Android SDK installation under Windows 2018-04-18 11:29:28 -05:00
Ben Liblit 9295bcdd0d 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-18 11:29:28 -05:00
Ben Liblit afd4bb49bb 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-18 11:29:28 -05:00
Ben Liblit 1d2a8a3e7e Factor out recurring pattern in download tasks 2018-04-18 11:29:28 -05:00
Ben Liblit 03e43d100b 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-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 7fd8f02382 Replicate test include/exclude patterns already used in Maven builds 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 3d026d409e Download appropriate Android SDK for current OS 2018-04-18 11:29:28 -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 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 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 031740338f Get a Dalvik test to work by putting "dx.jar" where expected 2018-04-18 11:29:27 -05:00
Ben Liblit 2e54ec4b0c 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-18 11:29:26 -05:00
Ben Liblit da30f5dbb4 Enable a few more tests that started working, or perhaps always did 2018-04-18 11:29:26 -05:00
Ben Liblit 51f748bddc Replicate Maven's heap size limits for tests 2018-04-18 11:29:26 -05:00
Ben Liblit 5c30dd7581 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-18 11:29:26 -05:00
Ben Liblit 91ca24584b 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-18 11:29:26 -05:00