Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-78 8a86c01a3 -> e08316176


GEODE-342: Make changes to Geode gradle build script to also build JVSD
        - Switched from maven to gradle.
        - Modified global gradle script to include geode-jvsd in the build and 
distribution.
        - Added individual tasks to clone, compile and install MultiAxisChartFX 
in the build process.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e0831617
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e0831617
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e0831617

Branch: refs/heads/feature/GEODE-78
Commit: e083161763d961eb3e6cc4cfaefe2b4c46cdd697
Parents: 8a86c01
Author: jujoramos <jujora...@gmail.com>
Authored: Thu Jan 14 15:18:36 2016 +0000
Committer: Vince Ford <vfor...@apache.org>
Committed: Mon Feb 1 23:53:32 2016 -0800

----------------------------------------------------------------------
 gemfire-assembly/build.gradle |   7 +-
 geode-jvsd/README.txt         |  84 +++++++-------------
 geode-jvsd/build.gradle       |  96 +++++++++++++++++++++++
 geode-jvsd/pom.xml            | 155 -------------------------------------
 geode-jvsd/runjvsd.sh         |   8 --
 settings.gradle               |   1 +
 6 files changed, 132 insertions(+), 219 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0831617/gemfire-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/gemfire-assembly/build.gradle b/gemfire-assembly/build.gradle
index f65930d..d0abb31 100755
--- a/gemfire-assembly/build.gradle
+++ b/gemfire-assembly/build.gradle
@@ -20,13 +20,14 @@ configurations {
 
 dependencies {
   provided project(':gemfire-core')
-  
+
   archives project(':gemfire-json')  
   archives project(':gemfire-joptsimple')  
   archives project(':gemfire-jgroups')  
   archives project(':gemfire-core')  
   archives project(':gemfire-web')
   archives project(':gemfire-web-api')
+  archives project(':geode-jvsd')
 
   testCompile project(path: ':gemfire-junit', configuration: 'testOutput')
   testCompile project(path: ':gemfire-core', configuration: 'testOutput')
@@ -190,6 +191,10 @@ distributions {
         from gfshDepsJar
       }
 
+      into ('tools/jvsd') {
+       from project(":geode-jvsd").installDist
+      }
+
       into ('tools/Extensions') {
         from 
(project(":gemfire-web").configurations.archives.allArtifacts.files) {
           exclude '*.jar'

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0831617/geode-jvsd/README.txt
----------------------------------------------------------------------
diff --git a/geode-jvsd/README.txt b/geode-jvsd/README.txt
index 7ff9d63..4656063 100644
--- a/geode-jvsd/README.txt
+++ b/geode-jvsd/README.txt
@@ -1,66 +1,40 @@
-Check Java JDK version, it should version 1.8.0_60 or later.
-
-$java --version
+#######################################################################################################################
+####################################################   REQUIREMENTS    
###############################################
+#######################################################################################################################
+# Check Java JDK version, it should be 1.8.0_60 or later.
+$java -version
 java version "1.8.0_60"
 Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
 Java HotSpot(TM) Server VM (build 25.60-b23, mixed mode)
 
-$jps
-13760 Jps
- 
-Clone Geode from the Apache repository, checkout JVSD branch and then build 
Geode. 
- 
+# Check Maven version, it should be 3.2.3 or later (required by MultiAxisChart)
+$mvn -version
+Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 
2014-08-11T21:58:10+01:00)
+Java version: 1.8.0_60, vendor: Oracle Corporation
+
+# Clone Geode from the Apache repository and checkout JVSD branch. 
 $git clone https://git-wip-us.apache.org/repos/asf/incubator-geode.git
 $cd incubator-geode/
-$git branch jvsd origin/feature/GEODE-78
-$git checkout jvsd
-$./gradlew clean build installDist -Dskip.tests=true
-
-Clone and build the third party charting library MultiAxisChartFX.
-$cd ..
-$git clone https://github.com/gemfire/MultiAxisChartFX
-$cd MultiAxisChartFX/
-$mvn install
-
-Install the MultiAxisChart jar into local maven repository.
+$git branch feature/GEODE-78 origin/feature/GEODE-78
+$git checkout feature/GEODE-78
 
-$mvn install:install-file \
--Dfile=./MultiAxisChart-1.0-SNAPSHOT.jar \
--DgroupId=com.pivotal.javafx \
--DartifactId=MultiAxisChart \
--Dversion=1.0-SNAPSHOT \
--Dpackaging=jar \
--DgeneratePom=true
+# Build and install the third party charting library, MultiAxisChartFX.
+$./gradlew geode-jvsd:MultiAxisChart
 
-For testing, additional jars may need to be added from the Apache Geode build 
to
-the local Maven repository. 
-
-mvn install:install-file -Dfile=gemfire-core-1.0.0-incubating-SNAPSHOT.jar \
--DgroupId=org.apache.geode \
--DartifactId=gemfire-core \
--Dversion=1.0.0-incubating-SNAPSHOT \
--Dpackaging=jar \
--DgeneratePom=true
-
-mvn install:install-file -Dfile=gemfire-jgroups-1.0.0-incubating-SNAPSHOT.jar \
--DgroupId=org.apache.geode \
--DartifactId=gemfire-jgroups \
--Dversion=1.0.0-incubating-SNAPSHOT \
--Dpackaging=jar \
--DgeneratePom=true
-
-mvn install:install-file -Dfile=fastutil-7.0.2.jar \
--DgroupId=org.apache.geode \
--DartifactId=fastutil \
--Dversion=7.0.2 \
--Dpackaging=jar \
--DgeneratePom=true
+#######################################################################################################################
+####################################################           BUILD           
###############################################
+#######################################################################################################################
+# Build Geode.
+$./gradlew clean build installDist -Dskip.tests=true
 
-Change back into the Geode directory and then into the JVSD directory. Build 
JVSD.
-$cd ../incubator-geode
-$cd geode-jvsd/
-$mvn install
+# Build Only jVSD.
+$./gradlew geode-jvsd:clean geode-jvsd:build geode-jvsd:installDist 
-Dskip.tests=true
 
-Run the JVSD application.
-$runjvsd.sh
+#######################################################################################################################
+####################################################           RUN             
###############################################
+#######################################################################################################################
+# Run from source.
+$./gradlew geode-jvsd:run
 
+# Run from distribution.
+$./geode-jvsd/build/install/geode-jvsd/bin/geode-jvsd

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0831617/geode-jvsd/build.gradle
----------------------------------------------------------------------
diff --git a/geode-jvsd/build.gradle b/geode-jvsd/build.gradle
new file mode 100755
index 0000000..e9c13b6
--- /dev/null
+++ b/geode-jvsd/build.gradle
@@ -0,0 +1,96 @@
+// Force Java 8 usage. 
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
+
+// Override parent compiler options.
+gradle.taskGraph.whenReady( { graph ->
+       tasks.withType(JavaCompile).each { javac ->
+               javac.configure {
+                       sourceCompatibility '1.8'
+                       targetCompatibility '1.8'
+                       options.encoding = 'UTF-8'
+               }
+       }
+})
+
+// Application plugin.
+apply plugin: 'application'
+mainClassName = 'org.apache.geode.jvsd.fx.Main'
+
+// Exclude master project dependencies.
+// FIXME: there must be a better way to do this.
+configurations{
+       all*.exclude group: 'cglib'
+       all*.exclude group: 'org.jmock'
+       all*.exclude group: 'org.assertj'
+       all*.exclude group: 'org.mockito'
+       all*.exclude group: 'org.ow2.asm'
+       all*.exclude group: 'org.hamcrest'
+       all*.exclude group: 'org.objenesis'
+       all*.exclude group: 'edu.umd.cs.mtc'
+       all*.exclude group: 'pl.pragmatists'
+       all*.exclude group: 'org.springframework'
+       all*.exclude group: 'com.github.stefanbirkner'
+}
+
+// Dependencies.
+dependencies {
+       compile 'commons-cli:commons-cli:1.2'
+       compile 'commons-collections:commons-collections:3.2.1'
+       compile 'com.pivotal.javafx:MultiAxisChart:1.0-SNAPSHOT'
+
+       testRuntime 'javax.transaction:jta:1.1'
+       testRuntime 'org.apache.logging.log4j:log4j:2.1'
+       testRuntime 'org.apache.logging.log4j:log4j-api:2.1'
+       testRuntime 'org.apache.logging.log4j:log4j-core:2.1'
+
+       testCompile project(':gemfire-core')
+       testCompile project(':gemfire-jgroups')
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// MultiAxisChartFX dependency.
+buildscript {
+       repositories {
+               mavenCentral()
+       }
+
+       dependencies {
+               classpath 'org.ajoberstar:gradle-git:1.3.2'
+       }
+}
+
+// Clone repository only if the directory is not created already.
+import org.ajoberstar.grgit.*
+task MultiAxisChartFX {
+       description 'Clone project MultiAxisChartFX and install the artifact 
into the local Maven repository.'
+       ext.destDir = new File(buildDir, 'MultiAxisChartFX')
+
+       onlyIf { 
+               !destDir.exists()
+       }
+
+       doLast {
+               println "Cloning MultiAxisChartFX..."
+               Grgit.clone(dir: destDir, uri: 
'https://github.com/gemfire/MultiAxisChartFX')
+               println "Cloning MultiAxisChartFX... Done!"
+
+               println "Installing MultiAxisChartFX into local maven 
repository..."
+               ant.exec(executable: 'mvn', dir: 'build/MultiAxisChartFX') {
+                       arg(line: 'clean install')
+               }
+               println "Installing MultiAxisChartFX into local maven 
repository... Done!"
+       }
+}
+
+// We need the external artifact before compiling the source code.
+compileJava {
+       dependsOn MultiAxisChartFX
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0831617/geode-jvsd/pom.xml
----------------------------------------------------------------------
diff --git a/geode-jvsd/pom.xml b/geode-jvsd/pom.xml
deleted file mode 100644
index 8e1fdd5..0000000
--- a/geode-jvsd/pom.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.geode</groupId>
-    <artifactId>geode-jvsd</artifactId>
-    <version>1.0-SNAPSHOT</version>
-    <packaging>jar</packaging>
-
-    <properties>
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-            <version>1.2</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-collections</groupId>
-            <artifactId>commons-collections</artifactId>
-            <version>3.2.1</version>
-        </dependency>
-        <!-- Enable only for Java 1.7 support
-        <dependency>
-                <groupId>com.oracle</groupId>
-                <artifactId>javafx</artifactId>
-                <version>2.2.60</version>
-                <scope>system</scope>
-                <systemPath>${java.home}/lib/jfxrt.jar</systemPath>
-        </dependency>
-        -->
-        <dependency>
-            <groupId>com.pivotal.javafx</groupId>
-            <artifactId>MultiAxisChart</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <!-- use scope and system path only if not installing jar into 
local maven repo -->
-            <!--<scope>system</scope>
-            
<systemPath>${HOME}/Projects/MultiAxisChartFX/target/MultiAxisChart-1.0-SNAPSHOT.jar</systemPath>
 -->
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geode</groupId>
-            <artifactId>gemfire-core</artifactId>
-            <version>1.0.0-incubating-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geode</groupId>
-            <artifactId>gemfire-jgroups</artifactId>
-            <version>1.0.0-incubating-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.10</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>2.1</version>
-            <!--<scope>test</scope> -->
-            <type>pom</type> 
-        </dependency>
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-api</artifactId>
-            <version>2.1</version>
-            <!--<scope>test</scope> -->
-        </dependency>
-        <dependency>
-            <groupId>org.apache.logging.log4j</groupId>
-            <artifactId>log4j-core</artifactId>
-            <version>2.1</version>
-            <!--<scope>test</scope> -->
-        </dependency>
-        <dependency>
-            <groupId>org.apache.geode</groupId>
-            <artifactId>fastutil</artifactId>
-            <version>7.0.2</version>
-            <type>jar</type>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.transaction</groupId>
-            <artifactId>jta</artifactId>
-            <version>1.1</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <finalName>geode-jvsd</finalName>
-
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-shade-plugin</artifactId>
-                <version>1.3.1</version>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                        <configuration>
-                            <transformers>
-                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
-                            </transformers>
-                            <!-- <artifactSet> <includes> 
<include>org.mortbay.jetty:jetty*</include> 
-                            </includes> </artifactSet> -->
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            
<mainClass>org.apache.geode.jvsd.fx.Main</mainClass>
-                        </manifest>
-                    </archive>
-                    <descriptorRefs>
-                        <descriptorRef>jar-with-dependencies</descriptorRef>
-                    </descriptorRefs>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>2.5.1</version>
-                <configuration>
-                    <source>${maven.compiler.source}</source>
-                    <target>${maven.compiler.target}</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0831617/geode-jvsd/runjvsd.sh
----------------------------------------------------------------------
diff --git a/geode-jvsd/runjvsd.sh b/geode-jvsd/runjvsd.sh
deleted file mode 100755
index 41f869c..0000000
--- a/geode-jvsd/runjvsd.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-echo `which java`
-
-if [ -f target/geode-jvsd-jar-with-dependencies.jar ]; then
-    java -verbose:class -jar target/geode-jvsd-jar-with-dependencies.jar $@ 
>output.txt
-else
-    echo "missing critical jar file, rebuild"
-fi

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0831617/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index 4b2da7b..93080db 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -9,6 +9,7 @@ include 'gemfire-web'
 include 'gemfire-web-api'
 include 'gemfire-assembly'
 include 'gemfire-rebalancer'
+include 'geode-jvsd'
 
 def minimumGradleVersion = '2.3'
 if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {

Reply via email to