changeset 702:156f08e92fe0

Add Makefile in order to ease building core + eclipse bits. In order to build thermostat core: $ make core In order to build everything (includes Eclipse stuff): $ make or $ make eclipse The default target builds everything and uses a private maven repository. Expect Maven/Tycho to download the world since the repo will be empty for you. I've also changed README accordingly. This addresses PR1129. Reviewed-by: omajid, vanaltj, ebaron, neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-September/003465.html
author Severin Gehwolf <sgehwolf@redhat.com>
date Fri, 19 Oct 2012 18:52:07 +0200
parents cf01b2bc4f4a
children b15571e2ce7d
files Makefile README
diffstat 2 files changed, 136 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Fri Oct 19 18:52:07 2012 +0200
@@ -0,0 +1,44 @@
+MAVEN           = mvn
+SKIP_TESTS      = false
+REPO_LOC        = $(HOME)/.thermostat/.build/mvn_repository
+MAVEN_FLAGS     = 
+
+#
+# Do not change anything below
+#
+REPO_FLAG       = -Dmaven.repo.local=$(REPO_LOC)
+GOAL            = package
+POM             = pom.xml
+
+ifeq ($(SKIP_TESTS),true)
+	MAVEN_SKIP_TEST = -Dmaven.test.skip=true
+endif
+
+all: eclipse
+
+core:
+	$(MAVEN) -f $(POM) $(MAVEN_FLAGS) $(MAVEN_SKIP_TEST) clean $(GOAL)
+
+core-install: create-repo-dir
+	$(MAVEN) -f $(POM) $(MAVEN_FLAGS) $(REPO_FLAG) $(MAVEN_SKIP_TEST) clean install
+
+eclipse-test-deps: core-install
+	$(MAVEN) -f eclipse/test-deps-bundle-wrapping/pom.xml $(MAVEN_FLAGS) $(REPO_FLAG) $(MAVEN_SKIP_TEST) clean install
+
+eclipse-test-p2: eclipse-test-deps
+	$(MAVEN) -f eclipse/test-deps-p2-repository/pom.xml $(MAVEN_FLAGS) $(REPO_FLAG) $(MAVEN_SKIP_TEST) clean $(GOAL)
+
+eclipse: eclipse-test-p2
+	$(MAVEN) -f eclipse/pom.xml $(MAVEN_FLAGS) $(REPO_FLAG) $(MAVEN_SKIP_TEST) clean $(GOAL)
+
+create-repo-dir:
+	mkdir -p $(REPO_LOC)
+
+clean-repo:
+	find $(REPO_LOC)/com/redhat/thermostat -print0 | xargs -0 rm -rf
+
+echo-repo:
+	echo "Using private Maven repository: $(REPO_LOC)"
+
+# We only have phony targets
+.PHONY:	all core eclipse-test-deps eclipse-test-p2 eclipse create-repo-dir clean-repo echo-repo
--- a/README	Fri Oct 19 10:52:15 2012 -0400
+++ b/README	Fri Oct 19 18:52:07 2012 +0200
@@ -1,17 +1,23 @@
 Thank you for downloading Thermostat.
 
-This document contains the following information useful to compile and run
-Thermostat:
+
+CONTENT:
+--------------------------------------------------------------------------------
 
-1. REQUIREMENTS
-2. BUILDING THERMOSTAT
-3. RUNNING THERMOSTAT
-4. PASSING JVM SPECIFIC OPTIONS
-5. GNOME KEYRING
+1.  REQUIREMENTS
+2.  BUILDING THERMOSTAT
+2.1   BUILDING THERMOSTAT CORE
+2.2   BUILDING THERMOSTAT ECLIPSE
+3.  RUNNING THERMOSTAT
+3.1   RUNNING THERMOSTAT CORE
+3.1.1 PASSING JVM SPECIFIC OPTIONS
+3.1.2 GNOME KEYRING
+3.2   RUNNING THERMOSTAT ECLIPSE
+4.  REFERECES
 
 
 --------------------------------------------------------------------------------
-REQUIREMENTS
+1. REQUIREMENTS
 
 * OpenJDK7
 
@@ -20,6 +26,8 @@
 
 * Maven (it will download all the java dependencies for you)
 
+* Make
+
 * MongoDB server
 
 Thermostat requires mongodb (http://www.mongodb.org/) server >= 2.0.0
@@ -44,40 +52,74 @@
    aptitude install libgnome-keyring-dev
 
 --------------------------------------------------------------------------------
-BUILDING THERMOSTAT
+2. BUILDING THERMOSTAT
+
+Thermostat consists of "Thermostat Core" and "Thermostat Eclipse".
 
-1. Run "mvn clean package". All tests should pass and the build should succeed.
+Thermostat Core consists of:
+  * CLI client
+  * Swing GUI client
+  * The thermostat agent
+
+Thermostat Eclipse is an Eclipse-based Thermostat client.
+
+--------------------------------------------------------------------------------
+2.1. BUILDING THERMOSTAT CORE
+
+2.1.1.
+   Run "make core". All tests should pass and the build should succeed.
    Requires a graphical environment for the ui tests.
    
    You can skip the tests phase by running:
    
-   mvn clean package -Dmaven.test.skip=true
+   make core SKIP_TESTS=true
 
-   If maven is too chatty, you can try to pass the -q option too:
+   If maven is too chatty, you can try to pass the "-q" option via MAVEN_FLAGS::
    
-   mvn -q clean package -Dmaven.test.skip=true
+   make core SKIP_TESTS=true MAVEN_FLAGS="-q"
    
-2. The resultant Thermostat system can now be found under the directory
+2.1.2.
+   The resulting Thermostat system can now be found under the directory
    distribution/target.
            
-            
 --------------------------------------------------------------------------------
-RUNNING THERMOSTAT
+2.2. BUILDING THERMOSTAT ECLIPSE
+
+2.2.1.
+   Run "make eclipse". This will build both, Thermostat Core and Thermostat
+   Eclipse. All tests should pass and the build should succeed. Running Eclipse
+   plug-in tests will open an Eclipse instance during build. This requires a
+   working graphical environment and DISPLAY.
 
-0. cd into distribution/target directory just created
+   You can skip the tests phase by running:
+
+   make eclipse SKIP_TESTS=true
+
+2.2.2.
+   This produces a local "update-site" or p2 repository from which you can
+   install Thermostat Eclipse into your Eclipse. The repository is at:
 
-1. To start the agent and the db:
-   bin/thermostat service
+   eclipse/composite-repo/target/composite-repo
+
+--------------------------------------------------------------------------------
+3. RUNNING THERMOSTAT
+
+--------------------------------------------------------------------------------
+3.1. RUNNING THERMOSTAT CORE
 
-2. To start the gui client:
-   bin/thermostat gui
+  cd into distribution/target directory just created
+
+  To start the agent and the db:
+  bin/thermostat service --start
 
-3. To start the cli client:
-   bin/thermostat [--help]
+  To start the gui client:
+  bin/thermostat gui
+
+  To start the cli client:
+  bin/thermostat [--help]
 
 
---------------------------------------------------------------------------------
-PASSING JVM SPECIFIC OPTIONS
+3.1.1. PASSING JVM SPECIFIC OPTIONS
 
 In some cases, it may be desirable to pass arguments to the virtual machine,
 for example to increase memory or change the look and feel for the Swing Client.
@@ -93,8 +135,7 @@
     -J-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel
 
 
---------------------------------------------------------------------------------
-GNOME KEYRING
+3.1.2. GNOME KEYRING
 
 Thermostat includes experimental support to store user credentials in the
 Gnome Keyring daemon, this support is currently limited to passwords only.
@@ -113,3 +154,27 @@
 saved in the user session keychain and available to other applications that
 can access the keyring. 
 
+--------------------------------------------------------------------------------
+3.2. RUNNING THERMOSTAT ECLIPSE
+
+  The "eclipse/composite-repo/target/composite-repo" directory was
+  produced during step 2.2. In order to use this local repository
+  follow these steps:
+
+    "Help" => "Install New Software..."
+    "Add..."
+    "Local..."
+    Select "eclipse/composite-repo/target/composite-repo"
+    Give it any name you like and click "OK".
+    Select "Thermostat Eclipse Plug-ins", then "Next >"
+    Click through dialog, accepting options.
+   
+  After this you should be able to see Thermostat views in Eclipse:
+    "Window" => "Show View" => "Other..." => "Thermostat" 
+            
+
+--------------------------------------------------------------------------------
+4. REFERECES
+
+  User Guide:
+    http://icedtea.classpath.org/wiki/Thermostat/UserGuide