Commit Graph

281 Commits

Author SHA1 Message Date
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
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 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
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 74523f5058 Enable caching of task outputs for custom build tasks 2018-04-18 11:29:29 -05:00
Ben Liblit 000b21f36e Rename a build task to more clearly reflect what it builds
This task has an input named "hello_hash.ml", and an output named
"hello_hash.jar".  So calling this task "generateHelloHash" is too
vague.  Now we call it "generateHelloHashJar" instead.
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 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 17fc048599 Generalize post-import Eclipse run configuration for more fixups
Previously this launcher's job was to run "processTestResources" and
any other Gradle tasks needed to create files that Eclipse was
expecting to be available.  But we also want to use it to revert the
bad changes that Buildship applies to ".launch" configuration files.

This is a temporary hack to work around
<https://github.com/eclipse/buildship/issues/653>.
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 1d8869bb0a Start exploring publication features by adding source jar archives 2018-04-18 11:29:28 -05:00
Ben Liblit fca0f7c117 Fix jar exclusion patterns to match what Ant uses
One previously-failing test class now passes.  Progress!
2018-04-18 11:29:28 -05:00
Ben Liblit fc0b951ead Assume that Eclipse needs all standard test-resource processing 2018-04-18 11:29:28 -05:00
Ben Liblit 39781604a2 Create a broad "Process Test Resources" Eclipse launch configuration
This should prepare test resources for all subprojects.  A WALA
developer should run this once before running any tests inside
Eclipse.  Initially I'd hoped to make this more narrowly focused, but
Eclipse just doesn't have the infrastructure to deal with fine-grained
dependencies.  On the other hand, running "./gradlew
eclipsePrepareTestResources" automatically for each build seems like
overkill, and could end up being rather slow.  So for now we require
that the developer run this once, by hand.
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 b3dab4c2b0 Tweak Buildship-generated Eclipse ".project" file for extra jars 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 5b825997bf Be more concise by calling property setters instead of assigning 2018-04-18 11:29:26 -05:00
Ben Liblit 2aadd55227 Change archive file names while unpacking, rather than in two stages 2018-04-18 11:29:26 -05:00
Ben Liblit 70fd9a3091 Remove "extraBundledJars" task, which nothing else actually uses
Some tests in other subprojects do depend on some these extra jar
files.  But they can declare those specific dependencies as needed.
Nothing seems to depend on the entire group of extra jars, so it's not
really useful to declare a task that is merely an alias for all of
them.
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 0bb899b503 Download, extract, and/or construct various additional bundled jars
I don't really know what these are all used for.  However, Maven+Ant
builds them, so for now Gradle should too.
2018-04-18 11:29:26 -05:00
Ben Liblit 1ebabf8b60 Complain more loudly about missing output directories 2018-04-18 11:29:25 -05:00
Ben Liblit ba5849afb6 Simplify inclusion of "OSGI-INF" and the only file it contains 2018-04-18 11:29:25 -05:00
Ben Liblit 6bcca003a2 Tweak output dirs to match what Buildship puts into ".classpath" 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 4b48f8ee4d 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-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 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 cd304237ea 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 5df33f85d7 Simplify how we refer to the outputs of certain tasks 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 e42e36c4de Rename a build task to more clearly reflect what it builds
This task has an input named "hello_hash.ml", and an output named
"hello_hash.jar".  So calling this task "generateHelloHash" is too
vague.  Now we call it "generateHelloHashJar" instead.
2018-04-17 15:02:36 -05:00
Ben Liblit 4f94b4c341 Extend Gradle's "clean" task to remove some additional build targets 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 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 84f1977ab4 Generalize post-import Eclipse run configuration for more fixups
Previously this launcher's job was to run "processTestResources" and
any other Gradle tasks needed to create files that Eclipse was
expecting to be available.  But we also want to use it to revert the
bad changes that Buildship applies to ".launch" configuration files.

This is a temporary hack to work around
<https://github.com/eclipse/buildship/issues/653>.
2018-04-17 15:02:36 -05:00
Ben Liblit 709c38c049 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-17 15:02:36 -05:00
Ben Liblit e4f8d00cbe Start exploring publication features by adding source jar archives 2018-04-17 15:02:36 -05:00
Ben Liblit 2763589d1f Fix jar exclusion patterns to match what Ant uses
One previously-failing test class now passes.  Progress!
2018-04-17 15:02:36 -05:00
Ben Liblit 196dd2d971 Assume that Eclipse needs all standard test-resource processing 2018-04-17 15:02:36 -05:00
Ben Liblit 5b7e3f750e Create a broad "Process Test Resources" Eclipse launch configuration
This should prepare test resources for all subprojects.  A WALA
developer should run this once before running any tests inside
Eclipse.  Initially I'd hoped to make this more narrowly focused, but
Eclipse just doesn't have the infrastructure to deal with fine-grained
dependencies.  On the other hand, running "./gradlew
eclipsePrepareTestResources" automatically for each build seems like
overkill, and could end up being rather slow.  So for now we require
that the developer run this once, by hand.
2018-04-17 15:02:35 -05:00