Commit Graph

245 Commits

Author SHA1 Message Date
Sungho Lee 4a31927b00 Gradle build scripts 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 3f5460231e Don't try to exhaustively anticipate all generated header names
When JNI headers for a given class, each nested class will end up with
its own additional header.  But I don't want to try to parse nested
class details out of the Java source files just so we can determine
exactly which headers will be created.  Instead, simply treat the
entire header destination directory as the output of this task.
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 5b1aed99a7 Minor indentation fix 2018-04-17 15:02:36 -05:00
Ben Liblit faf3b86e1b 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-17 15:02:36 -05:00
Ben Liblit d230fe836c Trivial whitespace tweak 2018-04-17 15:02:36 -05:00
Ben Liblit eb2d2dd850 Exclude one macOS test that I don't know how to fix right now 2018-04-17 15:02:36 -05:00
Ben Liblit 2674806aa5 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-17 15:02:35 -05:00
Ben Liblit a3f524f7a9 Compute a library path from the corresponding linker task
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.
2018-04-17 15:02:35 -05:00
Ben Liblit 2a6eee85a4 rpath only matters for shared libraries 2018-04-17 15:02:35 -05:00
Ben Liblit 3b8e32b322 Add previously-undeclared dependency of tests on native library 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
Ben Liblit 6fec4bba94 RPath settings apply only to Linux; some only to Linux on x86_64
I don't know whether Windows or MacOS needs anything similar.  If they
do, the details will differ, and should be handled by adding suitable
cases to these switch statements.
2018-04-17 15:02:35 -05:00
Ben Liblit e32b495354 Prefer single-quoted (non-interpolated) strings where sufficient 2018-04-17 15:02:35 -05:00
Ben Liblit fd4d68d278 Buildship removed classpath provider thing from all launch configs
This consistently happens when I import WALA as an existing Gradle
project into Eclipse with Buildship.  I don't really know what this
change means, or whether it's desirable.  For now, I'm going to trust
Buildship and see what happens.
2018-04-17 15:02:35 -05:00
Ben Liblit 8f52ab8d36 Simplify inclusion of "OSGI-INF" and the only file it contains 2018-04-17 15:02:35 -05:00
Ben Liblit d14d40ee3f Tweak output dirs to match what Buildship puts into ".classpath" 2018-04-17 15:02:35 -05:00
Ben Liblit efd3a6ab18 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-17 15:02:35 -05:00
Ben Liblit da27efec97 Have Buildship add Eclipse plugin (PDE) nature to some subprojects
Specifically, we need this for subprojects that build included plugins
for any of the "*_feature" subprojects.
2018-04-17 15:02:35 -05:00
Ben Liblit be11083cd8 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-17 15:02:35 -05:00
Ben Liblit 2bc0768242 Simplify loading of plugins shared by many subprojects 2018-04-17 15:02:35 -05:00
Ben Liblit db348b4ddd Clean up some simple syntactic redundancy in dependency declarations 2018-04-17 15:02:35 -05:00
Ben Liblit e64fbc7050 Find the "xlator_test" shared library at test run time
Dependencies are still not set properly here, so you need to have
built the shared library ("./gradlew xlator_testSharedLibrary") before
running the ":com.ibm.wala.cast.test:test" test task.  But at least
the tests do now find and load that shared library properly.
2018-04-17 15:02:35 -05:00
Ben Liblit 651f40c170 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-17 15:02:35 -05:00
Ben Liblit f7c7419351 Cleaner way to form colon-deliminated search path from list of paths 2018-04-17 15:02:35 -05:00
Ben Liblit 1a3a1570af Declare common library dependencies for source sets, not binaries
No sense repeating this for each binary when it's the same for all of
them.
2018-04-17 15:02:35 -05:00
Ben Liblit 35e04bc598 Add a second native library and a native executable 2018-04-17 15:02:35 -05:00
Ben Liblit 695cd2863c Properly distinguish main from test code, now that I know how 2018-04-17 15:02:35 -05:00
Ben Liblit 401fbaf89a Many improvements to Gradle build support, including within Eclipse 2018-04-17 15:02:35 -05:00
Sungho Lee 6dceb3d8ef Change build.gradle files for proper format and delete all tests 2018-04-17 15:00:03 -05:00
Sungho Lee 04923544f0 Gradle build scripts 2018-04-17 15:00:03 -05:00
Julian Dolby 742b42efdf native config cleanup 2018-01-20 17:40:10 +00:00
Ben Liblit 0286c2b048 Use Iterator2Iterable helper to convert more loops to for-each 2017-12-04 14:04:39 -08:00
Ben Liblit ebfd885d22 Use modern for-each loops where possible
Java sources used as test data have been excluded from this mass
clean-up.
2017-11-28 14:44:53 -06:00
Ben Liblit 9ef6ff1a9c Remove "build.xml" files not used by corresponding "pom.xml" files 2017-11-26 18:11:56 -06:00
Julian Dolby 207181aa89 linking issues on Linux. It seems that the name 'launch' for a function was causing some weird linking issues that only happened sometimes. Quite ikely, the issue is another library using the same name. 2017-10-18 01:49:25 +00:00
Julian Dolby b504165e64 clean up native init 2017-10-17 20:12:42 -04:00
Julian Dolby e399d7b9f3 Merge branch 'master' of https://github.com/wala/WALA 2017-09-16 18:19:07 +00:00
Julian Dolby bd8bf7cb99 fixes for paths on travis 2017-08-25 11:08:54 -04:00
Julian Dolby b6af5267f1 java 8 changes
minor fixes, such as making CheckForFrontEndErrors more accessible
minor hacks to make stuff compile with TeaVM
2017-08-25 10:58:00 -04:00
Julian Dolby e599d58cd7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-16 14:50:12 -04:00
Julian Dolby 3371e23de0 java 8 stuff 2017-08-16 14:50:01 -04:00
Ben Liblit b70d69d62f Treat many Eclipse plugin-related problems as errors
These are all problems that Eclipse can detect, but that it detects no
instances of right now.  Treating these as warnings instead of errors
should help prevent us from slipping backward in the future.
2017-08-16 11:36:46 -07:00
Ben Liblit 4da719edbc Exclude a directory containing only C code from the Java build path 2017-08-16 11:36:46 -07:00
Julian Dolby a92b881c22 Merge branch 'master' of https://github.com/wala/WALA 2017-08-15 12:39:27 -04:00
Julian Dolby 6431cbeb60 java 8 2017-08-15 12:39:19 -04:00
Ben Liblit 5bcc985069 Tidy up some code that performs unchecked casts to a generic type 2017-08-15 09:16:59 -07:00
Ben Liblit daea7095e2 Fix Eclipse warnings about unchecked casts to generics
This is the first time I can ever remember explicitly casting to
`Object`.  Such a cast might seem useless, and certainly it is
statically known to always succeed.  However, it is here for good
reason.  Without the cast, we end up making a `Pair<Object, ?>` but
what we really want is a `Pair<Object, Object>`.
2017-08-15 09:16:59 -07:00
Ben Liblit bb6be21e2d Fix remaining "unlikely argument type" warnings from Eclipse Oxygen
Each of these required careful consideration of what the original
developer *intended* as distinguished from what the developer's code
actually *does*.  I believe I got each one right, and WALA's
regression tests agree.  A second opinion by a core WALA developer
would be welcome, though.
2017-08-15 09:16:14 -07:00
Julian Dolby 2e3836c487 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 23:33:45 +00:00
Julian Dolby 8282340ec3 merge 2017-08-06 23:33:40 +00:00
Julian Dolby 15f54f0248 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 10:30:32 -04:00
Manu Sridharan e8bdf2f8f9 version 1.4.4-SNAPSHOT 2017-08-06 07:25:20 -07:00
Julian Dolby 69929b4985 Merge branch 'master' of https://github.com/wala/WALA 2017-08-06 08:06:02 -04:00
Manu Sridharan d901b13425 version 1.4.3 2017-08-05 20:52:32 -07:00
Julian Dolby eaba8d59b7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-05 21:09:34 -04:00
Julian Dolby 5b6397297f merge 2017-08-02 12:28:25 -04:00
Julian Dolby 10d88f3208 try javadoc 2017-08-01 22:41:21 +00:00
Julian Dolby 27e906135f Merge branch 'master' of https://github.com/wala/WALA 2017-07-24 10:08:10 -04:00
Ben Liblit d3c4200bc3 Disable Eclipse warnings about name shadowing
Previously we had 242 such warnings.  That large number suggests that
the WALA developers consider this to be an acceptable coding style.
If that's so, then it's better to hide these warnings rather than keep
them around as a perpetual distraction.
2017-07-18 20:43:36 -07:00
Ben Liblit 2f44bbf518 Help Emacs recognize that these are (fragments of) makefiles 2017-07-14 21:46:46 -07:00
Ben Liblit 433cd78f65 Move logic from "cbuild.sh" into portable "Makefile.configuration"
In "com.ibm.wala.cast.test", the "cbuild.sh" script is gone entirely.
Instead, "pom.xml" directs Maven to run "make" directly.  We still
have a "Makefile.configuration" file in this project, but this file is
now independent of where WALA is being built and of where Java is
installed.

In "com.ibm.wala.cast", a small "cbuild.sh" remains, to do some
special processing involving Visual Studio variables under Windows.
When not building under Windows, "cbuild.sh" now simply runs "make".
It may well be possible to hoist the special Windows stuff up into
this subproject's "pom.xml", or to change that "pom.xml" to run
"cbuild.sh" only when on Windows, and to run "make" directly
otherwise.  I don't know "pom.xml" stuff very well, though.  We still
have a "Makefile.configuration" file in this project, but this file is
now independent of where WALA is being built and of where Java is
installed.

The changes I've made in both "Makefile.configuration" files use GNU
make extensions.  I assume that's safe because "Makefile.definitions"
already relies on GNU make.
2017-07-14 21:44:33 -07:00
Julian Dolby 004a81deba Merge branch 'master' of https://github.com/wala/WALA 2017-07-13 13:02:29 -04:00
Ben Liblit 0e6b00e29f Revert accidental, harmless, but unnecessary make config changes 2017-07-12 10:39:06 -07:00
Ben Liblit 1d27ca974b Upgrade raw-types-usage warnings to errors where possible
In general, these diagnostics are now errors in projects for which all
such warnings have been fixed.  There are three unfixed warnings in
two projects, so this diagnostic remains a warning (not an error) in
those projects.

There are also many places where rwa-types-usage warnings have been
locally suppressed using @SuppressWarnings annotations.  I haven't
systematically revisited those to see if any can be fixed properly.
So for those projects this diagnostic must also remain a warning (not
an error), since @SuppressWarnings does not work on things Eclipse is
configured to treat as errors.
2017-07-12 10:39:06 -07:00
Ben Liblit e316471d88 Fix nearly all Eclipse warnings about using raw types
Along the way, I also converted many "for (;;)" loops into modern
"for (:)" loops.  I didn't systematically look for all opportunities
to do this, though.  I merely made this change where I was already
converting raw Iterator uses into modern Iterator<...> uses.

Better use of generics also allowed many casts to become statically
redundant.  I have removed all such redundant casts.

Only three raw-types warnings remain after this batch of fixes.  All
three involve raw uses of CallGraphBuilder.  I've tried to fix these
too, but it quickly snowballs into a cascade of changes that may or
may not eventually reach a statically-type-save fixed point.  I may
give these last few problem areas another go in the future.  For now,
though, the hundreds of other fixes seem worth keeping even if there
are a few stragglers.

This commit may change some public APIs, but only by making weaker
type signatures stronger by replacing raw types with generic types.
For example, we may change something like "Set" into "Set<String>",
but we're not adding new arguments, changing any
underlying (post-generics-erasure) types, etc.
2017-07-12 10:39:06 -07:00
Julian Dolby 289efc3bb8 Merge branch 'master' of https://github.com/wala/WALA 2017-07-12 08:08:34 -04:00
Julian Dolby a910795e05 merge 2017-07-09 05:58:20 -04:00
Ben Liblit 0bbe9970c6 Enable Eclipse Oxygen's new "unlikely argument types" diagnostics
There are two such diagnostics: one for collection methods and one for
equals().  See
<https://www.eclipse.org/eclipse/news/4.7/jdt.php#unlikely-argument-types>
for more information about these two new diagnostics.

For each of these diagnostics, I've set the severity level to
"warning" in projects that have some instances of the suspicious code,
or to "error" in projects that have no instances of the suspicious
code.
2017-07-08 13:22:00 -07:00
Julian Dolby 773fa68a3f made native test run on a linux vm 2017-06-29 09:07:29 +00:00
Julian Dolby 5f0a7180d0 merge 2017-06-28 18:37:03 -04:00
Julian Dolby facb4d7e35 merge 2017-06-28 18:28:19 -04:00
Julian Dolby f3a38f50d8 more linking 2017-06-28 17:56:04 -04:00
Julian Dolby 9789eb4216 remove import 2017-06-28 17:36:34 -04:00
Julian Dolby 6a6bf888e8 try some static linking 2017-06-28 17:30:55 -04:00
Julian Dolby c51321f4ba try to load libs on linux 2017-06-28 16:26:03 -04:00
Julian Dolby a8ba39fa99 kill native test for now 2017-06-28 15:59:22 -04:00
Julian Dolby 5374ce3169 more linking 2017-06-28 15:38:38 -04:00
Julian Dolby d8f6bf2a26 more linking hacks 2017-06-28 15:24:22 -04:00
Julian Dolby 8c8f352325 link object file 2017-06-28 15:06:47 -04:00
Julian Dolby 3722190ece try extern "C" 2017-06-28 14:48:05 -04:00
Julian Dolby cf4b27a065 linking 2017-06-28 13:44:17 -04:00
Julian Dolby c979c9700e header needed on linux 2017-06-28 13:37:26 -04:00
Julian Dolby 5c242e8e10 more .. fussiness on linux
someone does not like -std=c++11
2017-06-28 13:04:51 -04:00
Julian Dolby 7c476eac3d native interface for WALA 2017-06-28 12:42:49 -04:00
Julian Dolby 7ea9bca169 Merge branch 'master' of https://github.com/wala/WALA 2017-06-26 15:05:29 -04:00
Ben Liblit 3187d09c1f Roll some diagnostics back to ignore instead of warning or error
These should mostly be things that we've already decided earlier that
we explicitly don't want to "fix" because they simply disagree with
the WALA project's coding style.
2017-06-26 11:16:09 -07:00
Ben Liblit fb9042d3a6 Activate more Eclipse diagnostics, and treat many warnings as errors
The additional diagnostics are ones that were previously being
ignored, but which we seem to have been ignoring by default rather
than as a conscious choice.

For diagnostics of which we currently have *zero* instances, treat
these as errors rather than merely warnings.  The intent is to
permanently lock out future regressions of things we've completely
fixed.  In the future, whenever we fix the last instance of a given
warning in a given Eclipse project, we should also promote that
diagnostic to an error to keep things clean into the future.
2017-06-26 11:16:09 -07:00
Julian Dolby f900eab5e2 fix classpath bug 2017-06-24 18:11:43 -04:00
Julian Dolby a31dd02ab2 native support 2017-06-24 18:45:54 +02:00
Ben Liblit 9c81cae9be Externalize bundle names and vendors
This fixes 33 Eclipse "The value for attribute '...' is not
externalized.  The value must begin with %" warnings in the "Plug-in
Development" category.
2017-06-07 17:42:11 +02:00
Ben Liblit 72c754e874 Declare private methods static wherever possible
If a method is private, there's no risk that a subclass elsewhere
might be overriding it and depending on dynamic dispatch to choose the
right implementation.  So all of these private methods can safely be
declared static without risk of regression in either WALA code or
unseen third-party code.
2017-06-07 08:29:23 -07:00
Ben Liblit e1d2fa9850 Suppress Eclipse warnings about potentially-static methods
The "potentially" qualifier is here because these methods are visible
outside the WALA source tree.  These methods may seem OK to be static
based on the code we have here, but we have no way of knowing whether
third-party code expected to be able to subclass and override.  I'm
going to play it safe and assume that we want to allow that.

Note that we are still allowing Eclipse warnings about methods that
can *definitely* be declared static; a different configuration option
controls these.  For private methods, final methods, and methods in
final classes, if the code seems static-safe based on what we have
here, then that's good enough: we don't need to worry about
third-party overrides.
2017-06-07 08:29:23 -07:00
Ben Liblit e753aba3cc Fix warnings about unset javacProjectSettings build entries (#176)
Specifically, these are all warnings of the form "The
'javacProjectSettings' build entry should be set when there are project
specific compiler settings".
2017-05-04 11:44:32 -07:00
Manu Sridharan c9022b0743 update version to 1.4.3-SNAPSHOT 2017-04-19 09:19:09 -07:00
Manu Sridharan 44e433085e tag 1.4.2 release 2017-04-19 09:17:13 -07:00
Ben Liblit d35e8d0fa2 Disable Eclipse warnings about missing version constraints
Specifically, we're turning off Eclipse warnings about missing version
constraints on required bundles ("Require-Bundle"), exported
packages ("Export-Package"), and imported packages ("Import-Package").
We're not turning these off absolutely everywhere, though: only in
packages where one or more such warnings were actually being reported.
So if a given package was already providing all version constraints
for, say, package imports, then we've kept that warning on in that
package.

Honestly I don't entirely understand the practical implications of
these warnings.  However, there were 355 of them across many WALA
subprojects.  I take this as evidence that the WALA developers do not
consider these version constraints to be important.  Therefore, we may
as well stop warning about something we have no intention of fixing.

That being said, if we *do* want to fix some or all of these, I
welcome any advice on what those fixes should look like.  I am rather
ignorant about all things OSGi.
2017-03-28 20:37:41 -05:00
Manu Sridharan ab7e638c29 version 1.4.2-SNAPSHOT 2017-03-25 13:54:21 -07:00