Commit Graph

695 Commits

Author SHA1 Message Date
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
Sungho Lee 3984cd0001 Fill the dynamic library path for OSX 2018-04-18 11:29:25 -05:00
Sungho Lee c1f6b70eb0 Fill the dynamic library path for OSX 2018-04-18 11:29:25 -05:00
Ben Liblit 1432e18c37 Clean up some simple syntactic redundancy in dependency declarations 2018-04-18 11:29:25 -05:00
Ben Liblit 69a67fe7ec Better handling of OS- and architecture-specific JDK paths 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 04d9397a1d Tweak classpath for some Javadoc build tasks
This comes up when the Javadoc comments refer to classes in other
subprojects that the corresponding Java code did not actually depend
upon.
2018-04-18 11:29:25 -05:00
Ben Liblit e52c8d981d 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-18 11:29:25 -05:00
Ben Liblit b9e712bfa9 Add a second native library and a native executable 2018-04-18 11:29:25 -05:00
Ben Liblit 43a482dfae Add Gradle logic for building a native library
This approach uses no external makefiles; it's pure Gradle.  Nice!
2018-04-18 11:29:25 -05:00
Ben Liblit 377d7586ef Consistently use simple sorted order for dependencies
This isn't even sorting by library or subproject name.  It's just a
dumb textual sort of the contents of each line.
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 530d74929f Many improvements to Gradle build support, including within Eclipse 2018-04-18 11:29:24 -05:00
Sungho Lee 50d0f7ee71 Change build.gradle files for proper format and delete all tests 2018-04-18 11:29:24 -05:00
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 5df33f85d7 Simplify how we refer to the outputs of certain tasks 2018-04-17 15:02:36 -05:00
Ben Liblit 272e3adaf8 Tell Eclipse to ignore some questionable manifest contents
These manifest files are here for use by the Maven build, but Eclipse
is now using Gradle (via Buildship).  So the manifests as seen by
Eclipse do not entirely make sense.  I'm hesitant to change the
manifests directly, since presumably they were correct for Maven and
still are.

Perhaps some day we'll be using Gradle to generate manifests.  Until
that day comes, we're better off leaving the manifests as they are and
just suppressing Eclipse's warnings instead.
2018-04-17 15:02:36 -05:00
Ben Liblit 7a5f140127 Restore old manifests in hope of fixing Maven regressions 2018-04-17 15:02:36 -05:00
Ben Liblit 08dc11ad7d Incremental improvements to Windows JDK library configuration
This still doesn't actually work, but it's closer than it was before.
There's still some problem with improper mixing of 32-bit ("x86") and
64-bit ("x64") libraries.
2018-04-17 15:02:36 -05:00
Ben Liblit e8b86fdf82 Clean up questionable memory management during string construction
Avoid allocating memory using strdup() and then releasing it using
operator delete.  strdup()-allocated memory should be released using
free(), not delete.  But in these specific cases, there really was
never any good reason to duplicate the C-style strings in the first
place.  Instead, we can safely pass those NUL-terminated char pointers
directly in calls to JNI's NewStringUTF().  NewStringUTF() does not
take ownership of its argument, but rather clones that string data
internally before returning.  So using strdup() and delete was just
unnecessary memory churn.

In cases where we need to format, concatenate, or construct new
strings, don't use sprintf() into variable-sized, stack-allocated
arrays.  Variable-sized arrays are not portable, and in particular are
rejected by Microsoft's Visual Studio 2017 C++ compiler.  Instead, do
our string formatting and manipulations using std::ostringstream
and/or std::string.  We just need to be a bit careful about the
lifetimes and ownership responsibilities of allocated data.  In
brief, (1) ostringstream::str() returns a temporary string instance
that expires at the end of the enclosing statement, independent of the
lifetime of the ostringstream instance; while (2) string::c_str()
returns an pointer to internal data that remains valid as long as the
string on which it was called is valid and unmodified.
2018-04-17 15:02:36 -05:00
Ben Liblit 4b04f8d812 Somebody decided to use three-space indentation in this file only
OK, whatever makes you happy.
2018-04-17 15:02:36 -05:00
Ben Liblit e9fa6f31b3 Fill in likely (but untested) JVM library path on Windows 2018-04-17 15:02:36 -05:00
Ben Liblit cac0e87082 Fix remaining Javadoc warnings
This fixes the last of our Javadoc warnings without creating a
circular dependency between ":com.ibm.wala.cast:javadoc" and
":com.ibm.wala.cast.js:javadoc".  Fixes #4, wherein more details about
this tricky dependency challenge can be found.
2018-04-17 15:02:36 -05:00
Ben Liblit 62d7980ea3 Fix various warnings produced by "./gradlew javadoc"
Three stubborn warnings remain, but this is progress!
2018-04-17 15:02:35 -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 9df594189d Compute a library path from the native software model
Previously we were repeating the library path twice, but that's not
good for long-term maintenance.  That being said, extracting this
information from the depths of the native software model seems *far*
more complex than it should be.  I had hoped for something nicer in
response to
<https://discuss.gradle.org/t/compute-wl-rpath-flag-suitable-for-native-shared-library/25278>,
but so far there's nothing.
2018-04-17 15:02:35 -05:00
Ben Liblit b2ba188176 Avoid random leftover junk by using "Sync" instead of "Copy" 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 be8f22145e Teach Gradle how to find and copy a Jar archive that we bundle
I'm not actually sure why this archive is needed, except that it is
mentioned in "META-INF/MANIFEST.MF" and "build.properties".  If we
eventually stop supporting Maven, then we may be able to discard the
"copyJarsIntoLib" task and the corresponding lines in
"META-INF/MANIFEST.MF" and "build.properties"
2018-04-17 15:02:35 -05:00
Ben Liblit 18e34918d5 This is no longer how we'll build the native library in Eclipse 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
Sungho Lee 41fe177e89 Fill the dynamic library path for OSX 2018-04-17 15:02:35 -05:00
Sungho Lee 2e03ded0f8 Fill the dynamic library path for OSX 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 95d7bf775e Better handling of OS- and architecture-specific JDK paths 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 a81d583cbf Tweak classpath for some Javadoc build tasks
This comes up when the Javadoc comments refer to classes in other
subprojects that the corresponding Java code did not actually depend
upon.
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