JAL-3210 project name explicitly set. updated README_GRADLE_JALVIEWJS...md file....
authorBen Soares <bsoares@dundee.ac.uk>
Tue, 22 Oct 2019 09:57:55 +0000 (10:57 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Tue, 22 Oct 2019 09:57:55 +0000 (10:57 +0100)
README_GRADLE_JALVIEWJS-2019-10-15.md [deleted file]
README_GRADLE_JALVIEWJS-2019-10-22.md [new file with mode: 0644]
build.gradle
gradle.properties
settings.gradle [new file with mode: 0644]

diff --git a/README_GRADLE_JALVIEWJS-2019-10-15.md b/README_GRADLE_JALVIEWJS-2019-10-15.md
deleted file mode 100644 (file)
index 610ce9b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Last updated: 2019-10-09
-
-# TRANSPILING USING ECLIPSE AS AN EXTERNAL CLI TOOL:
-
-Download and install a clean eclipse-jee-2019-06 (or eclipse-jee-2019-09)
-
-In gradle.properties edit `jalviewjs_eclipse_root` to point to the root dir.
-If you're on a mac, DO NOT include the `Eclipse.app` folder in the path (use the path up to this point, but not the .app folder itself).
-You can use a '~' as the first character which will get replaced with `System.getProperty("user.home")`.
-
-Note that the gradle tasks (`jalviewjsEclipseCopyDropins`) will take care of copying `net.sf.j2s.core.jar` and the `com.seeq.eclipse.importprojects.jar` into the `dropins` and `plugins` dir (on either unix or mac -- not tested on windows yet).
-
-Note that the logs from the transpile go into `build/jalviewjs/` as `j2s-transpile.out` and `j2s-transpile.err`
-
-gradle tasks possibly of interest to you:
-
-
-
-```
-gradle jalviewjs  # (should build the build/jalviewjs/site dir)
-
-gradle jalviewjsSiteTar  # will produce build/distribution/site.tar.gz
-
-gradle jalviewjsTranspile  # should run a new eclipse compile+transpile
-
-gradle jalviewjsServerStart  # will run a localhost http server to allow you to test the site in a browser.  Just use the URL given in the output.  To stop the server you have to do  gradle --stop  or you can just leave it running until the gradle daemon dies.
-```
-
-If it's working okay, you just need to to
-
-```
-gradle jalviewjs
-gradle jalviewjsServer
-```
-
-and go to the localhost URL in the output of the jalviewjsServer task in your web browser (on a mac, just right clicking on the URL in terminal window gives an "Open URL" option which is nice and easy).
-
-
diff --git a/README_GRADLE_JALVIEWJS-2019-10-22.md b/README_GRADLE_JALVIEWJS-2019-10-22.md
new file mode 100644 (file)
index 0000000..34e682b
--- /dev/null
@@ -0,0 +1,70 @@
+Last updated: 2019-10-22
+
+# TRANSPILING USING ECLIPSE AS AN EXTERNAL CLI TOOL:
+
+
+1) Download and install a clean eclipse jee-2019-09:
+
+RECOMMEND using the eclipse installer found at https://www.eclipse.org/downloads/packages/installer
+and installing in ~/buildtools/eclipse/jee-2019-09 (which is what the gradle.properties property jalviewjs_eclipse_root is set to by default).
+
+
+2) Check the `jalviewjs_eclipse_root` property in `gradle.properties`:
+
+If you have an eclipse 2019-06 or 2019-09 installed already elsewhere that you want to try and use then change the
+```
+jalviewjs_eclipse_root
+```
+property in gradle.properties to point to the folder that the application is installed in.  If you are on macOS this is the folder _above_ Eclipse.app (i.e. the folder Eclipse.app is in).
+If on Windows or Linux then this can be the folder that the eclipse installer says it is installing too (usually something like `.../jee-2019-09`) (even though it then installs it to a folder `eclipse` under that) or the folder the eclipse binary and plugins folders etc are in (`build.gradle` will check both the folder stated in `jalviewjs_eclipse_root` and `${jalviewjs_eclipse_root}/eclipse`).
+
+You can use a '~' as the first character which will get replaced with `System.getProperty("user.home")`.
+
+
+3) That's it, but note the following:
+
+i) Note that the gradle task (`jalviewjsEclipseCopyDropins`) will take care of copying the appropriate `net.sf.j2s.core.jar` and the `com.seeq.eclipse.importprojects.jar` into the `dropins` dir (tested on both unix or mac -- not tested on windows yet).
+
+ii) Note that we have two versions of `net.sf.j2s.core.jar`, currently manifesting in two different `utils/jalviewjs/eclipse/dropins_4.1?` folders.  This is because the behaviour of eclipse changed between 2019-06 (4.12) and 2019-09 (4.13) that meant the `src` and `test` BuildContexts are separated during the Eclipse build.  This overwrites the list of classes to be transpiled with the set of classes from the last BuildContext to be compiled (which inevitablt seems to be tests).  The way the file paths are represented must also have changed so that the exclusion from `j2s.ecluded.paths` in the `.j2s` file are not honoured.
+I have made a fixed version of `net.sf.j2s.core_3.2.4-FOR_4.13.jar` that ought to be backward compatible, but for unknown reason doesn't work in eclipse 4.12.
+Hopefully this is temporary and Bob can incorporate a properly backward compatible fix.
+
+iii) Note that the logs from the transpile go into `build/jalviewjs/j2s-transpile.out` which combines both stdout and stderr.
+
+
+# CLI
+
+gradle tasks possibly of interest to you:
+```
+gradle jalviewjs  # (should build the build/jalviewjs/site dir)
+
+gradle jalviewjsSiteTar  # will produce build/distribution/site.tar.gz
+
+gradle jalviewjsTranspile  # should run a new eclipse compile+transpile
+
+gradle jalviewjsServerStart  # will run a localhost http server to allow you to test the site in a browser.  Just use the URL given in the output.  To stop the server you have to do  gradle --stop  or you can just leave it running until the gradle daemon dies.
+```
+
+If it's working okay, you just need to to
+```
+gradle jalviewjs
+gradle jalviewjsServer
+```
+and go to the localhost URL in the output of the jalviewjsServer task in your web browser (on a mac, just right clicking on the URL in terminal window gives an "Open URL" option which is nice and easy).
+
+
+# IN ECLIPSE
+
+If you are developing in Eclipse as IDE (which is the natural way to use Eclipse!) and have the plugin installed, then you will obviously not need to run the transpile as a gradle task -- it will be performed automatically.
+
+Some things to remember:
+i) You will need the buildship plugin (part of the JEE package).
+ii) If you haven't already, remember to run on the CLI
+```
+gradle cleanEclipse eclipse jalviewjsCreateJ2sSettings
+```
+to create clean jalview `.classpath, .project, .settings/org.eclipse.jdt.core.prefs, .j2s` files.
+You should only need to do this once.
+Be aware that manual changes to these files will likely be overwritten during some gradle tasks.
+
+
index fc47cb6..d575f18 100644 (file)
@@ -305,7 +305,7 @@ configurations {
 
 eclipse {
   project {
-    name = "Jalview with gradle build"
+    name = eclipse_project_name
 
     natures 'org.eclipse.jdt.core.javanature',
     'org.eclipse.jdt.groovy.core.groovyNature',
@@ -1353,10 +1353,16 @@ task jalviewjsEclipsePaths {
     eclipseBinary = eclipseRoot+"/Contents/MacOS/eclipse"
     eclipseProduct = eclipseRoot+"/Contents/Eclipse/.eclipseproduct"
   } else if (OperatingSystem.current().isWindows()) { // check these paths!!
+    if (file(eclipseRoot+"/eclipse").isDirectory() && file(eclipseRoot+"/eclipse/.eclipseproduct").exists()) {
+      eclipseRoot += "/eclipse"
+    }
     eclipseDropinsDir = eclipseRoot+"/dropins"
     eclipseBinary = eclipseRoot+"/eclipse"
     eclipseProduct = eclipseRoot+"/.eclipseproduct"
   } else { // linux or unix
+    if (file(eclipseRoot+"/eclipse").isDirectory() && file(eclipseRoot+"/eclipse/.eclipseproduct").exists()) {
+      eclipseRoot += "/eclipse"
+    }
     eclipseDropinsDir = eclipseRoot+"/dropins"
     eclipseBinary = eclipseRoot+"/eclipse"
     eclipseProduct = eclipseRoot+"/.eclipseproduct"
index 85ee158..b0c4113 100644 (file)
@@ -142,7 +142,7 @@ eclipse_extra_jdt_prefs_file = .settings/org.eclipse.jdt.core.jalview.prefs
 eclipse_project_name = jalview
 eclipse_bin_dir = bin
 
-jalviewjs_eclipse_root = ~/buildtools/eclipse/eclipse-jee-2019-09/eclipse
+jalviewjs_eclipse_root = ~/buildtools/eclipse/jee-2019-09
 
 jalviewjs_utils_dir = utils/jalviewjs
 jalviewjs_eclipse_dropins_dir = eclipse/dropins
diff --git a/settings.gradle b/settings.gradle
new file mode 100644 (file)
index 0000000..d284cee
--- /dev/null
@@ -0,0 +1 @@
+rootProject.name="jalview"