Commit Graph

5870 Commits

Author SHA1 Message Date
Ben Liblit 0510c914bb Update Gradle wrapper to release 4.9
Gradle 4.9 has no new features of particular interest to us.  It's
good to stay up-to-date, though.
2018-07-20 08:44:23 +02:00
Ben Liblit 72e9ba31f8 Use more complete Gradle package for better IDE support
In particular, using the "all" package (which includes source) allows
IntelliJ IDEA to provide autocompletion and other nice features that
are unavailable when using the "bin" package.
2018-07-20 08:44:23 +02:00
Ben Liblit c242f6126c Publish all generated Java bytecode jar archives
Previously we were only publishing source archives.  This fixes
wala/WALA#326 if I got everything right on the first try.  More likely
is that we will need a few rounds of revision before it's all doing
what it should.  For example, we may need to customize aspects of the
Gradle-generated "*.pom" files as described at
<https://docs.gradle.org/current/userguide/publishing_maven.html#sec:identity_values_in_the_generated_pom>
and
<https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom>.
2018-07-19 22:23:14 +02:00
Manu Sridharan 2b1d82d1bb Expand missing super test 2018-07-19 18:17:59 +02:00
Manu Sridharan a78af3f67e
Add API to add an InputStream for a jar to an AnalysisScope (#330)
This is useful, e.g., if you have the bytes of a jar file in memory and want to load it into an `AnalysisScope`.
2018-07-19 17:01:51 +02:00
Manu Sridharan aeb17dfca4
Allow for classes with missing superclasses in class hierarchy (#329)
Fixes #322 

We add an option `createPhantomSuperclasses` to `ClassHierarchy`.  When set, if a superclass is missing, we create a new `PhantomClass` in its place and allow the subclass to be added.

To use, you can create the `ClassHierarchy` with the new `ClassHierarchyFactory.makeWithPhantom` methods.
2018-07-19 16:10:35 +02:00
Julian Dolby 5edf49254c ore meta data 2018-07-19 14:02:04 +02:00
Julian Dolby fc261b6ee7 mata data 2018-07-19 13:51:06 +02:00
Julian Dolby 6e6b29339c latest dexlib 2018-07-19 12:45:17 +02:00
Julian Dolby 1bbca5a222 Merge branch 'master' of github.com:wala/WALA 2018-07-15 12:41:25 +02:00
Julian Dolby c5f812d784 fix script for python 3 2018-07-15 12:41:18 +02: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
Julian Dolby ed59197ae3
Merge pull request #325 from liblit/miscellaneous-ide-updates
Miscellaneous IDE updates
2018-07-12 12:57:40 -04:00
Ben Liblit 858148e91b Reorganize how we deal with shared JavaScript test examples
When IntelliJ IDEA imports WALA's Gradle configuration, it creates
what is calls a "module" for each sourceSet of each Gradle subproject.
In so doing, it automatically picks up the source and resource
directories used by each of these sourceSets.  Unfortunately, IntelliJ
IDEA does not allow multiple modules to share a single root directory
as their source or resource directories, and that's exactly what was
going on with the "example-src" subdirectory under
"com.ibm.wala.cast.js.test.data".

This revised Gradle configuration still has is copying the necessary
"example-src" resources to the appropriate locations for use as test
resources.  But IntelliJ IDEA no longer treats "example-src" as a root
directory for resources in the automatically-generated modules.  So
now we get along nicer with IntelliJ IDEA while keeping everything
working with Gradle as well.
2018-07-11 16:13:05 -05: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 7c2189849f Add a stub JDT preferences file, originally created by Buildship 2018-07-11 15:11:44 -05:00
Julian Dolby dc47e1da98 add default methods to instruction visitors
relax dump api
2018-07-10 21:53:48 -04:00
Julian Dolby ef89dc5345 a little tolerance for sloppy models 2018-07-04 15:46:06 -04:00
Julian Dolby bc0309b5ba Merge branch 'master' of github.com:wala/WALA 2018-06-27 14:58:10 -04:00
Julian Dolby fe1247f2ce switch to rhino 1.7.10 2018-06-27 14:57:35 -04:00
Ben Liblit 6be7a1a8a2 Have Travis CI periodically try to build each subproject separately
If Gradle dependencies are set up correctly, then it should be
possible to build any subproject starting with a pristine tree.
These take too long to use for every commit, pull request, etc.  But
running an extensive test like this periodically (e.g., weekly) seems
reasonable.
2018-06-26 09:19:02 -07:00
Ben Liblit 36320a078c Upgrade Gradle wrapper to release 4.8.1
No significant changes in this release that affect us, but it's good
to stay up-to-date.
2018-06-26 08:31:59 -07:00
Julian Dolby 0752bf321c Merge branch 'master' of github.com:wala/WALA 2018-06-22 21:49:06 -04:00
Julian Dolby 37eea27f4a more support for out-of-order lexical declarations 2018-06-22 19:49:49 -04:00
Julian Dolby 4de0ed876d remove overly conservative assertion 2018-06-22 07:26:38 -04:00
Julian Dolby af639ec654
Merge pull request #319 from liblit/minor-tidying-up
Minor tidying up
2018-06-10 22:01:03 -04:00
Ben Liblit bc86a27e85 Remove a subproject ".gitignore" whose patterns no longer apply
Perhaps files once existed here that matched the given exclusion
patterns, but there are certainly no such files here now.
2018-06-09 18:46:11 -05:00
Ben Liblit 2fcd079fe2 Anchor many ignore patterns that only apply at the topmost level 2018-06-09 18:46:11 -05:00
Ben Liblit ddeb2bd8ab Ignore a Visual Studio Code settings file
The settings I am seeing in here so far seem like per-developer
preferences, not shared per-project configuration information.
2018-06-09 18:46:11 -05:00
Ben Liblit c4f127f371 Subproject "com.ibm.wala.cast.js.test.data" contains no Java code 2018-06-09 18:46:11 -05:00
Julian Dolby b1b09684bd
Merge pull request #317 from liblit/future-java-compatibility-fixes
Future Java compatibility fixes
2018-06-06 12:52:51 -04:00
Ben Liblit 5336a08af2 Avoid using deprecated boxing constructors
Boxing a primitive using the constructor ("new Integer(4)") always
creates a distinct new boxed instance.  That's rarely what you need,
and in fact all of those constructors have been deprecated in Java 9.
Using the static "valueOf" method instead ("Integer.valueOf(4)") can
give better performance by reusing existing instances.  You no longer
get a unique boxed object, but generally that's OK.
2018-06-05 14:44:59 -05:00
Julian Dolby 9aed4e058d more tracking of sourse positions for function parameters 2018-06-05 15:00:31 -04:00
Ben Liblit 32e105a3c0 Skip a specific test if offline; this test requires network access 2018-06-04 12:29:57 -05:00
Ben Liblit 5cf8b7efe3 Stop using deprecated "javah" to generate JNI headers
"javah" was deprecated in Java 9, and has been removed entirely in
Java 10.  The right way to generate headers now is by using the "-h"
flag to "javac".  When "javac" is run in this way, it still generates
bytecode too.  So ideally, we'd run "javac" just once to generate
bytecode and headers simultaneously.  Fortunately, the Gradle JNI
plugin at <https://github.com/wpilibsuite/gradle-jni> help us do this
cleanly.  Nice!
2018-06-04 12:29:57 -05:00
Ben Liblit 85651608e9 Don't use interpolated strings unless actually needed 2018-06-04 12:28:42 -05:00
Ben Liblit 6679262707 Refactor linker logic, and add "smoke_main" to automated tests
Previously we were compiling and linking "smoke_main", but not
actually running it as part of automated testing.  I simply overlooked
this in the process of recreating the Maven build logic in Gradle.
Now we run "smoke_main" when testing, which turns out to be a pretty
good test of our management of both Java search paths as well as
linker / shared library search paths.
2018-06-04 12:28:42 -05:00
Ben Liblit fbac524a02 Find JVM shared library better across versions and operating systems
We now use "-rpath" on both Linux and macOS.  This linker flag sets
the ELF RPATH on Linux, and the "@rpath" attribute on macOS, but
effectively it's doing the same thing, and that same thing is exactly
what we want.  I think.

On Linux, we also now look for the JVM shared library in three
different places.  The library has moved between Java 8 and 9, and
even on Java 9 it goes in a different place on Fedora 28 versus Ubuntu
16.04.
2018-06-04 12:28:42 -05:00
Ben Liblit 24151e7422 Don't specify Java version; defaults to whatever JVM is being used 2018-06-04 12:28:42 -05:00
Ben Liblit c7344e611a Remove TODO comment about producing native components for test only
According to
<https://docs.gradle.org/current/userguide/native_software.html>,
"When you assemble dependents of a component, the component and all of
its dependents are compiled and linked, including any test suite
binaries."  So it's intentional that the "assemble" task causes
creation of the smoke_main executable and xlator_test shared library.
Nothing TODO here; the current behavior is as designed.
2018-06-04 12:28:42 -05:00
Ben Liblit 2067d6c37a Open up some more vertical white space 2018-06-04 12:28:42 -05:00
Ben Liblit 989ef3ec43 Help Java 9 with some tricky generics type inference
The existing code worked fine under Java 8, but Java 9 fails to
resolve type constraints unless it has more explicit information about
at least one of the arguments to anyOf.  Weird.
2018-06-04 12:28:42 -05:00
Julian Dolby d2852beebf
Merge pull request #312 from liblit/gradle-load-plugins-modernization
Load Gradle plugins using “plugins” closure rather than “apply plugin”
2018-06-04 12:22:33 -04:00
Julian Dolby d1840f0531 make slicer handle multiple languages, using the Language to build mod and ref visitors 2018-06-01 13:56:08 -04:00
Julian Dolby 196f7cb153 fix for nasty bug in decoding dup2_x2 2018-05-31 19:32:02 -04:00
Julian Dolby 400b2055ce break basic blocks at eachelementget instructions 2018-05-30 12:26:19 -04:00
Ben Liblit e2ce6a84b0 Load plugins using "plugins" closure rather than "apply plugin"
Apparently the latter is considered a "legacy method":
<https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_application>.
2018-05-23 16:47:58 -05:00
Julian Dolby 24d7757814
Merge pull request #309 from liblit/junit-4.12
Require JUnit 4.12 instead of 4.11
2018-05-21 21:46:05 -04:00
Julian Dolby 4a372eff2d
Merge pull request #308 from liblit/git-ignore-cleanups
Git ignore cleanups
2018-05-21 21:45:39 -04: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