You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/05/26 10:55:38 UTC
[2/3] isis git commit: ISIS-1413: adding gradle scripts for dynamic
compilation and copying over layout files.
ISIS-1413: adding gradle scripts for dynamic compilation and copying over layout files.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/bbc81a1a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/bbc81a1a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/bbc81a1a
Branch: refs/heads/master
Commit: bbc81a1a8187dea749b80513132b9094b92fd2c5
Parents: 086632e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed May 25 18:50:21 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Thu May 26 10:11:23 2016 +0100
----------------------------------------------------------------------
.../main/asciidoc/guides/_dg_ide_eclipse.adoc | 2 +-
.../main/asciidoc/guides/_dg_ide_intellij.adoc | 139 +++++++++++++++-
.../070-advanced/002-compiler-exclude.png | Bin 0 -> 31775 bytes
.../070-advanced/004-gradle-output.png | Bin 0 -> 23091 bytes
.../070-advanced/005-gradle-output.png | Bin 0 -> 16157 bytes
example/application/simpleapp/dom/.gitignore | 3 +
example/application/simpleapp/dom/build.gradle | 53 ++++++
.../dom/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 53556 bytes
.../gradle/wrapper/gradle-wrapper.properties | 6 +
example/application/simpleapp/dom/gradlew | 164 +++++++++++++++++++
example/application/simpleapp/dom/gradlew.bat | 90 ++++++++++
.../application/simpleapp/dom/layouts.gradle | 29 ++++
.../domainapp/dom/DomainAppDomManifest.java | 2 +-
scripts/updateGeneratedArchetypeSources.groovy | 2 +
14 files changed, 479 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/adocs/documentation/src/main/asciidoc/guides/_dg_ide_eclipse.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_dg_ide_eclipse.adoc b/adocs/documentation/src/main/asciidoc/guides/_dg_ide_eclipse.adoc
index 92d5436..e638308 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_dg_ide_eclipse.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_dg_ide_eclipse.adoc
@@ -159,7 +159,7 @@ And, remember also to configure Eclipse's DataNucleus plugin for these other dom
In this section are a couple of options that will reduce the length of the change code/build/deploy/review feedback loop.
-=== Setting up Dynamic Reloading
+=== Setting up DCEVM
link:github.com/dcevm/dcevm[DCEVM] enhances the JVM with true hot-swap adding/removing of methods as well as more
reliable hot swapping of the implementation of existing methods.
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/adocs/documentation/src/main/asciidoc/guides/_dg_ide_intellij.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_dg_ide_intellij.adoc b/adocs/documentation/src/main/asciidoc/guides/_dg_ide_intellij.adoc
index d1afd84..a356cb2 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_dg_ide_intellij.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_dg_ide_intellij.adoc
@@ -15,12 +15,13 @@ This material does not constitute an endorsement; JetBrains is not affiliated to
This section describes how to install and setup JetBrains' IntelliJ IDEA, then how to import an application into IntelliJ and run it.
-
+[[_dg_ide_intellij_installing]]
== Installing and Setting up
This section covers installation and setup. These notes/screenshots were prepared using IntelliJ Community Edition 14.1.x, but are believed to be compatible with more recent versions/other editions of the IDE.
+[[_dg_ide_intellij_installing_download]]
=== Download and Install
https://www.jetbrains.com/idea/download/[Download] latest version of IntelliJ Community Edition, and install:
@@ -63,6 +64,7 @@ image::{_imagesdir}appendices/dev-env/intellij-idea/010-installing/070-set-ui-th
+[[_dg_ide_intellij_installing_new-project]]
=== New Project
In IntelliJ a project can contain multiple modules; these need not be physically located together. (If you are previously an Eclipse user, you can think of it as similar to an Eclipse workspace).
@@ -218,6 +220,7 @@ image::{_imagesdir}appendices/dev-env/intellij-idea/044-other-settings-misc/010-
+[[_dg_ide_intellij_importing-maven-modules]]
== Importing Maven Modules
Let's load in some actual code! We do this by importing the Maven modules.
@@ -259,10 +262,12 @@ image::{_imagesdir}appendices/dev-env/intellij-idea/100-maven-module-mgmt/060-ig
+[[_dg_ide_intellij_running]]
== Running
Let's see how to run both the app and the tests.
+[[_dg_ide_intellij_running_the-app]]
=== Running the App
Once you've imported your Isis application, we should run it. We do this by creating a Run configuration, using `Run > Edit Configurations`.
@@ -288,6 +293,7 @@ WARNING: if you forget to set up the enhancer goal, or don't run it on the corre
You should now be able to run the app using `Run > Run Configuration`. The same configuration can also be used to debug the app if you so need.
+[[_dg_ide_intellij_running_unit-tests]]
=== Running the Unit Tests
The easiest way to run the unit tests is just to right click on the `dom` module in the _Project Window_, and choose run unit tests. Hopefully your tests will pass (!).
@@ -302,6 +308,8 @@ image::{_imagesdir}appendices/dev-env/intellij-idea/110-running-the-app/040-runn
Thereafter, you should run units by selecting this configuration (if you use the right click approach you'll end up with lots of run configurations, all similar).
+
+[[_dg_ide_intellij_running_integ-tests]]
=== Running the Integration Tests
Integration tests can be run in the same way as unit tests, however the `dom` module must also have been enhanced.
@@ -313,9 +321,19 @@ image::{_imagesdir}appendices/dev-env/intellij-idea/110-running-the-app/050-runn
+Also make sure that the `search for tests` radio button is set to `In single module`:
+
+image::{_imagesdir}appendices/dev-env/intellij-idea/400-running-integtests/run-debug-configuration-single-module.png[width="600px",link="{_imagesdir}appendices/dev-env/intellij-idea/400-running-integtests/run-debug-configuration-single-module.png"]
+
+If this radio button is set to one of the other options then you may obtain class loading issues; these result from IntelliJ attempting to run unit tests of the `dom` project that depend on test classes in that module, but using the classpath of the `integtests` module whereby the `dom` test-classes (`test-jar` artifact) are not exposed on the Maven classpath.
+
+
+
+[[_dg_ide_intellij_hints-and-tips]]
== Hints and Tips
+[[_dg_ide_intellij_hints-and-tips_keyboard-cheat-sheets]]
=== Keyboard Cheat Sheets
You can download 1-page PDFs cheat sheets for IntelliJ's keyboard shortcuts:
@@ -341,6 +359,7 @@ The Tool Windows are the views around the editor (to left, bottom and right). I
Using these shortcuts you can easily toggle between the tool windows and the editor, without using the mouse. Peachy!
+[[_dg_ide_intellij_hints-and-tips_navigating-around]]
=== Navigating Around
For all of the following, you don't need to type every letter, typing "ab" will actually search for ".*a.*b.*".
@@ -362,6 +381,7 @@ Viewing the structure (ie outline) of a class
** hit `ctrl-F12` again to also see inherited members
+[[_dg_ide_intellij_hints-and-tips_editing]]
=== Editing
* Extend selection using `ctrl-W`
@@ -385,6 +405,7 @@ In certain circumstances (eg in methods0) you can also type `ctrl-shift-space` t
Last, when invoking a method, use `ctrl-P` to see the parameter types.
+[[_dg_ide_intellij_hints-and-tips_refactoring]]
=== Refactoring
Loads of good stuff on the `Refactor` menu; most used are:
@@ -399,6 +420,7 @@ Loads of good stuff on the `Refactor` menu; most used are:
If you can't remember all those shortcuts, just use `ctrl-shift-alt-T` (might want to rebind that to something else!) and get a context-sensitive list of refactorings available for the currently selected object
+[[_dg_ide_intellij_hints-and-tips_plugins]]
=== Plugins
You might want to set up some additional plugins. You can do this using `File > Settings > Plugins` (or equivalently `File > Other Settings > Configure Plugins`).
@@ -418,6 +440,8 @@ Some others you might like to explore are:
.IntelliJ Plugins
image::{_imagesdir}appendices/dev-env/intellij-idea/050-some-plugins/020-some-plugins-confirmation.png[width="600px"]
+
+[[_dg_ide_intellij_hints-and-tips_plugins_maven-helper-plugin]]
==== Maven Helper Plugin
This plugin provides a couple of great features. One is better visualization of dependency trees (similar to Eclipse).
@@ -439,6 +463,7 @@ This menu can also be bound to a keystroke so that it is available as a pop-up:
image::{_imagesdir}appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/040-maven-quick-run.png[width="600px",link="{_imagesdir}appendices/dev-env/intellij-idea/050-some-plugins/maven-helper/040-maven-quick-run.png"]
+[[_dg_ide_intellij_troubleshooting]]
=== Troubleshooting
When a Maven module is imported, IntelliJ generates its own project files (suffix `.ipr`), and the application is actually built from that.
@@ -464,24 +489,120 @@ are set up correctly.
-== Running Integration Tests
+[[_dg_ide_intellij_advanced]]
+== Faster turnaround times
-When running integration tests from within IntelliJ, make sure that the `search for tests` radio button is set to `In single module`:
+In this section are several options that will reduce the time it takes between making a source code edit and seeing the results in the running app. code/build/deploy/review feedback loop.
-image::{_imagesdir}appendices/dev-env/intellij-idea/400-running-integtests/run-debug-configuration-single-module.png[width="600px",link="{_imagesdir}appendices/dev-env/intellij-idea/400-running-integtests/run-debug-configuration-single-module.png"]
-If this radio button is set to one of the other options then you may obtain class loading issues; these result from IntelliJ attempting to run unit tests of the `dom` project that depend on test classes in that module, but using the classpath of the `integtests` module whereby the `dom` test-classes (`test-jar` artifact) are not exposed on the Maven classpath.
+[[_dg_ide_intellij_advanced_gradle-compile-enhance]]
+=== Using Grade to compile/enhance
+Running an Apache Isis application requires that the DataNucleus enhancer runs on the compiled bytecode. As described xref:dg.adoc#_dg_ide_intellij_running_the-app[above], the recommended way to do this with IntelliJ is to use a Run configuration that runs the enhancer goal prior to launch.
+
+Alternative, you can use the following `build.gradle` script in your `dom` module:
+
+[source,groovy]
+.`build.gradle`
+----
+apply plugin: 'java'
+apply plugin: 'tangram.tools'
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
+version = (new XmlParser()).parse('pom.xml').parent.version.text()
+buildscript {
+ repositories {
+ maven { url "http://oss.jfrog.org/artifactory/oss-snapshot-local" }
+ jcenter()
+ }
+ dependencies {
+ classpath 'tangram:gradle-plugin:1.1.2'
+ }
+}
+repositories {
+ mavenLocal()
+ maven { url "http://oss.jfrog.org/artifactory/oss-snapshot-local" }
+ jcenter()
+}
+dependencies {
+ compile group: 'org.apache.isis.core', name: 'isis-core-applib', version: version
+}
+task copyClasses << {
+ copy {
+ from 'build/classes/main'
+ into 'target/classes'
+ }
+}
+----
+
+The script is intended to be in the background as a daemon while editing/developing; whenever a change is made to any
+source code, gradle will automatically compile _and_ enhance the code. In this way it eliminates the need to start up
+Maven and run the enhancer goal.
+
+To use, you must disable the IntelliJ's automatic building of the 'dom' project. This is done using:
+`File > Settings > Build, Execution, Deployment > Compiler > Excludes`, and then exclude the `.../dom/src/main/java`
+directory:
+
+image::{_imagesdir}appendices/dev-env/intellij-idea/070-advanced/002-compiler-exclude.png[width="800px",link="{_imagesdir}appendices/dev-env/intellij-idea/070-advanced/002-compiler-exclude.png"]
+
+
+The script is run using:
+
+[source,bash]
+----
+gradle -t --offline
+----
+
+from the command line (in the `dom` module).
+
+image::{_imagesdir}appendices/dev-env/intellij-idea/070-advanced/004-gradle-output.png[width="600px",link="{_imagesdir}appendices/dev-env/intellij-idea/070-advanced/004-gradle-output.png"]
+
+Use `ctrl-C` to cancel, as any other process.
+
+
+[[_dg_ide_intellij_advanced_gradle-layout]]
+=== Using Grade for ``layout.xml``s
+
+Similarly, gradle can be run to reduce the turn-around time when tweaking the UI (defined by the
+ xref:ugfun.adoc#_ugfun_object-layout_dynamic_xml[`*.layout.xml`] file for each domain class), when the app is running.
+
+The framework does already automatically notice any changes to `.layout.xml` files, but these do need to be on
+the classpath (in the `target/classes` directory). With IntelliJ this can be done by manually by invoking
+`Run > Reload Changed Classes`, and then refreshing the browser.
+
+Using this script though this manual step can be removed; whenever a change is made to any `.layout.xml` file, gradle
+will automatically copy over the file to the `target/classes` directory:
+
+[source,groovy]
+.`layouts.gradle`
+----
+defaultTasks 'copyLayouts'
+task copyLayouts(type:Copy) {
+ from 'src/main/java'
+ into 'target/classes'
+ include '**/*.layout.xml'
+}
+----
+
+The script is run using:
+
+[source,bash]
+----
+gradle -t --offline -b layouts.gradle
+----
+
+from the command line (in the `dom` module).
+
+image::{_imagesdir}appendices/dev-env/intellij-idea/070-advanced/005-gradle-output.png[width="600px",link="{_imagesdir}appendices/dev-env/intellij-idea/070-advanced/005-gradle-output.png"]
+
+Use `ctrl-C` to cancel, as any other process.
-[[_dg_ide_intellij_advanced]]
-== Advanced
-In this section are a couple of options that will reduce the length of the change code/build/deploy/review feedback loop.
[[_dg_ide_intellij_advanced_dcevm]]
-=== Setting up Dynamic Reloading
+=== Setting up DCEVM
link:github.com/dcevm/dcevm[DCEVM] enhances the JVM with true hot-swap adding/removing of methods as well as more
reliable hot swapping of the implementation of existing methods.
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/002-compiler-exclude.png
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/002-compiler-exclude.png b/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/002-compiler-exclude.png
new file mode 100644
index 0000000..ba9cb59
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/002-compiler-exclude.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/004-gradle-output.png
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/004-gradle-output.png b/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/004-gradle-output.png
new file mode 100644
index 0000000..023538d
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/004-gradle-output.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/005-gradle-output.png
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/005-gradle-output.png b/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/005-gradle-output.png
new file mode 100644
index 0000000..224c85e
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/images/appendices/dev-env/intellij-idea/070-advanced/005-gradle-output.png differ
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/.gitignore
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/.gitignore b/example/application/simpleapp/dom/.gitignore
new file mode 100644
index 0000000..cc3e383
--- /dev/null
+++ b/example/application/simpleapp/dom/.gitignore
@@ -0,0 +1,3 @@
+.gradle
+build/
+!gradle/wrapper/gradle-wrapper.jar
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/build.gradle
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/build.gradle b/example/application/simpleapp/dom/build.gradle
new file mode 100644
index 0000000..94d1b28
--- /dev/null
+++ b/example/application/simpleapp/dom/build.gradle
@@ -0,0 +1,53 @@
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// this gradle script compiles and enhances the dom classes.
+//
+// The script is intended to be used in conjunction with IntelliJ IDEA, to remove the necessity to run the DataNucleus
+// enhancer immediately before running the app, and therefore reduce the turn-around time. The script is run as
+// in the background as a daemon while editing/developing; whenever a change is made to any source code, gradle will
+// automatically compile *and* enhance the code.
+//
+// To use, just type:
+//
+// gradle -t
+//
+// It is also necessary to disable the IntelliJ's automatic building of the 'dom' project. This is done using:
+//
+// File > Settings > Build, Execution, Deployment > Compiler > Excludes
+//
+// and then exclude the .../dom/src/main/java directory
+//
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+defaultTasks 'compileJava', 'copyClasses'
+
+apply plugin: 'java'
+apply plugin: 'tangram.tools'
+
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
+version = (new XmlParser()).parse('pom.xml').parent.version.text()
+
+buildscript {
+ repositories {
+ maven { url "http://oss.jfrog.org/artifactory/oss-snapshot-local" }
+ jcenter()
+ }
+ dependencies {
+ classpath 'tangram:gradle-plugin:1.1.2'
+ }
+}
+repositories {
+ mavenLocal()
+ maven { url "http://oss.jfrog.org/artifactory/oss-snapshot-local" }
+ jcenter()
+}
+dependencies {
+ compile group: 'org.apache.isis.core', name: 'isis-core-applib', version: '1.13.0-SNAPSHOT'
+}
+task copyClasses << {
+ copy {
+ from 'build/classes/main'
+ into 'target/classes'
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.jar
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.jar b/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..ca78035
Binary files /dev/null and b/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.jar differ
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.properties b/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..e8c47aa
--- /dev/null
+++ b/example/application/simpleapp/dom/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 24 23:14:46 BST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/gradlew
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/gradlew b/example/application/simpleapp/dom/gradlew
new file mode 100644
index 0000000..27309d9
--- /dev/null
+++ b/example/application/simpleapp/dom/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/gradlew.bat
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/gradlew.bat b/example/application/simpleapp/dom/gradlew.bat
new file mode 100644
index 0000000..832fdb6
--- /dev/null
+++ b/example/application/simpleapp/dom/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/layouts.gradle
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/layouts.gradle b/example/application/simpleapp/dom/layouts.gradle
new file mode 100644
index 0000000..645b5e0
--- /dev/null
+++ b/example/application/simpleapp/dom/layouts.gradle
@@ -0,0 +1,29 @@
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// this gradle script copies over .layout.xml files from src to target directory.
+//
+// This script is intended to be used while the app is running (in prototype mode), reducing the turn-around time
+// when updating the layout.
+//
+// The framework does already automatically notice any changes to .layout.xml files, but these do need to be in the
+// target directory. Using IntelliJ (say) this would be done by manually by invoking
+// Run > Reload Changed Classes, and then refreshing the browser.
+//
+// This script instead is intended to be run in the background as a daemon; whenever a change
+// is made to any .layout.xml file, gradle will automatically copy over the file to the target directory.
+//
+// The script is run using:
+//
+// gradle -t -b layouts.gradle
+//
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+defaultTasks 'copyLayouts'
+
+task copyLayouts(type:Copy) {
+ from 'src/main/java'
+ into 'target/classes'
+ include '**/*.layout.xml'
+}
+
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java b/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
index 101cf27..63266f3 100644
--- a/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
+++ b/example/application/simpleapp/dom/src/main/java/domainapp/dom/DomainAppDomManifest.java
@@ -33,7 +33,7 @@ public class DomainAppDomManifest implements AppManifest {
@Override
public List<Class<?>> getModules() {
- return Arrays.asList(
+ return Arrays.<Class<?>>asList(
DomainAppDomainModule.class // domain (entities and repositories)
);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/bbc81a1a/scripts/updateGeneratedArchetypeSources.groovy
----------------------------------------------------------------------
diff --git a/scripts/updateGeneratedArchetypeSources.groovy b/scripts/updateGeneratedArchetypeSources.groovy
index 9e3a8c0..5d56cc8 100644
--- a/scripts/updateGeneratedArchetypeSources.groovy
+++ b/scripts/updateGeneratedArchetypeSources.groovy
@@ -254,6 +254,8 @@ appendedResourcesDir.mkdir()
def supplementalModelsFile=new File(appendedResourcesDir, "supplemental-models.xml")
supplementalModelsFile.text = supplemental_models_text
+
+
///////////////////////////////////////////////////
//
// helper methods