Commit Graph

5859 Commits

Author SHA1 Message Date
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
Ben Liblit b2e190ceed Remove a Java bytecode file that shouldn't be revision-tracked
We have the corresponding ".java" source file, so we can (and do)
rebuild this bytecode file whenever needed.
2018-05-21 16:15:53 -05:00
Ben Liblit 6fe9959a73 Ignore some more IntelliJ IDEA project metadata
I *think* that the per-module configuration metadata that goes here
should be per-developer, not tracked in git.
2018-05-21 16:14:48 -05:00
Ben Liblit 8146db20ff Remove git ignore patterns for several revision-tracked files
Someone may have thought that we were ignoring these files, but we
aren't.  From what I can tell, for these specific files, revision
tracking is intentional.
2018-05-21 16:14:48 -05:00
Julian Dolby 5236b95bd2 tighten type 2018-05-11 12:30:32 -04:00
Julian Dolby a3a6ce3f51 expose copy propagation records to allow better source position mapping even when copy propagation has occurred. 2018-05-09 18:10:20 -04:00
Julian Dolby 6b2db3e190 more-detailed source mapping information 2018-05-08 08:01:35 -04:00
Julian Dolby 8005b665b9 flexibility in how to model constants 2018-04-30 19:09:59 -04:00
Julian Dolby 2a7a98ed32 move code for sharing between javascript and python 2018-04-30 13:33:48 -04:00
Julian Dolby 27a8fff714 ast-based constant folding 2018-04-28 12:05:49 +02:00
Julian Dolby bc4939db97
Merge pull request #303 from liblit/tweaks-for-IntelliJ-IDEA
Tweaks for IntelliJ IDEA
2018-04-25 00:43:40 -04:00
Ben Liblit 45ea8969ed Add or ignore several metadata files created by IntelliJ IDEA
I decided which to keep and which to ignore by following advice given
at
<https://intellij-support.jetbrains.com/hc/en-us/articles/206544839>
and
<https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore>,
which in turn influenced <https://www.gitignore.io/api/jetbrains>.
2018-04-23 15:02:21 -05:00