Commit Graph

149 Commits

Author SHA1 Message Date
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 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 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
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
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 8529c10491 Use Gradle to create selected Eclipse metadata before Maven builds
The Eclipse metadata files created in this way are not identical to
those that Buildship would create when importing into Eclipse.  The
tests in com.ibm.wala.cast.java.test.JDTJava15IRTests and
com.ibm.wala.cast.java.test.JDTJavaIRTests seem to pass using either
the Gradle-generated or the Buildship-generated versions.

As an aside, if you generate these files using Gradle first and *then*
import using Buildship, you end up with metadata that is identical to
what you would have had if you'd only imported with
Buildship.  (There's one irrelevant difference in an unimportant
"<comment>" element.)  So Maven's tests should run fine under any
wacky mix of Gradle- and Buildship-generated Eclipse metadata files.

That being said, I recommend not mixing build systems.  WALA can be
built using either Maven, Gradle, or Eclipse+Buildship, but you're
probably better off only using one of these in any given build tree.
A mixed tree *should* probably work, but I haven't tested it
thoroughly, and consider better to avoid doing.

Incidentally, if there are other Maven-preparation steps that we'd
like Gradle to automate for us, that can now be done easily by
creating more "prepareMavenBuild" Gradle tasks in other subprojects
and adding the appropriate dependencies.  For example, it would be
trivial to use this to automate downloading "/tmp/DroidBench",
installing the Android SDK, etc.
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 1d2a8a3e7e Factor out recurring pattern in download tasks 2018-04-18 11:29:28 -05:00
Ben Liblit 848530f39a Experimental combined task for download and checksum verification
Not working yet:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.
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 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 8303eaba4c Override specific "cleanFooBar" tasks instead of generic "clean" 2018-04-18 11:29:26 -05:00
Ben Liblit 07dd646a40 Don't bother importing when we only need one symbol, one time 2018-04-18 11:29:26 -05:00
Ben Liblit 20cba8a8d8 Factor out recurring pattern of MD5 checksum + stamp file 2018-04-18 11:29:26 -05:00
Ben Liblit e9eb934b82 Give each verification task an output for better incremental building 2018-04-18 11:29:26 -05:00
Ben Liblit 1e1de1bdb9 Prefer single-quoted (non-interpolated) strings where sufficient 2018-04-18 11:29:26 -05:00
Ben Liblit 9a3ecd6ab9 Disable some Eclipse warnings on Java test inputs
I think these were previously not being compiled at all.  Now, with
Buildship generating Eclipse ".project" settings automatically, these
are being processed.  In general we don't care much about questionable
code in test data, though.
2018-04-18 11:29:25 -05:00
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 3ce242a22c Simplify loading of plugins shared by many subprojects 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 1ca17e93be Automated Gradle-driven download of JLex test input 2018-04-18 11:29:25 -05:00
Ben Liblit 209c1d25c6 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 742cad58e9 Use Gradle to create selected Eclipse metadata before Maven builds
The Eclipse metadata files created in this way are not identical to
those that Buildship would create when importing into Eclipse.  The
tests in com.ibm.wala.cast.java.test.JDTJava15IRTests and
com.ibm.wala.cast.java.test.JDTJavaIRTests seem to pass using either
the Gradle-generated or the Buildship-generated versions.

As an aside, if you generate these files using Gradle first and *then*
import using Buildship, you end up with metadata that is identical to
what you would have had if you'd only imported with
Buildship.  (There's one irrelevant difference in an unimportant
"<comment>" element.)  So Maven's tests should run fine under any
wacky mix of Gradle- and Buildship-generated Eclipse metadata files.

That being said, I recommend not mixing build systems.  WALA can be
built using either Maven, Gradle, or Eclipse+Buildship, but you're
probably better off only using one of these in any given build tree.
A mixed tree *should* probably work, but I haven't tested it
thoroughly, and consider better to avoid doing.

Incidentally, if there are other Maven-preparation steps that we'd
like Gradle to automate for us, that can now be done easily by
creating more "prepareMavenBuild" Gradle tasks in other subprojects
and adding the appropriate dependencies.  For example, it would be
trivial to use this to automate downloading "/tmp/DroidBench",
installing the Android SDK, etc.
2018-04-17 15:02:36 -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 813c79caa0 Factor out recurring pattern in download tasks 2018-04-17 15:02:36 -05:00
Ben Liblit 4749fe47c0 Experimental combined task for download and checksum verification
Not working yet:
<https://github.com/michel-kraemer/gradle-download-task/issues/108>.
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 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 df8a61a8d7 Override specific "cleanFooBar" tasks instead of generic "clean" 2018-04-17 15:02:35 -05:00
Ben Liblit f628ee1e08 Don't bother importing when we only need one symbol, one time 2018-04-17 15:02:35 -05:00
Ben Liblit 60870d7231 Factor out recurring pattern of MD5 checksum + stamp file 2018-04-17 15:02:35 -05:00
Ben Liblit 75270b18ca Give each verification task an output for better incremental building 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 51c9e062f4 Disable some Eclipse warnings on Java test inputs
I think these were previously not being compiled at all.  Now, with
Buildship generating Eclipse ".project" settings automatically, these
are being processed.  In general we don't care much about questionable
code in test data, though.
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 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 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 695cd2863c Properly distinguish main from test code, now that I know how 2018-04-17 15:02:35 -05:00
Ben Liblit 74e39ce101 Automated Gradle-driven download of JLex test input 2018-04-17 15:02:35 -05:00
Ben Liblit 25e2201ec6 Add Gradle build script for a subproject that previously had none 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
Ben Liblit 544a71ae72 Remove type arguments that Java 1.7+ can infer for us 2017-12-04 14:04:39 -08:00
Ben Liblit 11828c57f4 Update more parts of the build configuration to use Java 8
Julian Dolby assures me that WALA is now supposed to be using Java 8
everywhere.  This covers nearly all remaining places that I can find
where an earlier Java version was still being used.  (The few
exceptions are places where switching to Java 8 causes test failures.
I'll address those separately, probably by reaching out to the WALA
maintainers for help.)
2017-11-26 18:46:00 -06:00