From 0309baac62cc5354757ddcdf04707a3759a1d432 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Tue, 10 Sep 2013 10:48:03 +0900 Subject: [PATCH] Fix Makefile for sbt. Add sbt-eclipse project plugin --- Makefile | 45 +++++++++++++++++++++++++++------------------ development.md | 16 +++++++++++++--- project/plugins.sbt | 2 ++ 3 files changed, 42 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 3e4870dc..f9646be2 100755 --- a/Makefile +++ b/Makefile @@ -16,35 +16,44 @@ PREFIX=${HOME}/local MVN_OPT= -MVN=mvn $(MVN_OPT) +SBT=./sbt +PERL=perl +SED=sed -.PHONY: install test release-prepare release-perform clean update-version +.PHONY: compile archive pack install test release-sonatype clean superdev container +version:=$(shell $(PERL) -npe "s/version in ThisBuild\s+:=\s+\"(.*)\"/\1/" version.sbt | $(SED) -e "/^$$/d") -install: - bin/sbt pack && cd target/pack && $(MAKE) install -# $(MVN) install -Dmaven.test.skip=true -# cd utgb-shell; $(MAKE) PREFIX="$(PREFIX)" MVN_OPTS="-Dmaven.test.skip=true" install +pack: + $(SBT) pack -test: install - $(MVN) test +compile: + $(SBT) compile + +archive: target/utgb-$(version).tgz +target/utgb-$(version).tgz: + $(SBT) pack-archive -RELEASE_OPT="-DlocalCheckout=true" +install: pack + cd target/pack && $(MAKE) PREFIX=$(PREFIX) install + +test: install + $(SBT) test -release-prepare: - $(MVN) release:prepare $(RELEASE_OPT) -release-perform: - $(MVN) release:perform $(RELEASE_OPT) +release-sonatype: + $(SBT) publish-signed -release-rollback: - $(MVN) release:rollback clean: - $(MVN) clean + $(SBT) clean -update-version: - $(MVN) release:update-versions -DautoVersionSubmodules=true +# Run GWT super-dev mode +superdev: + $(SBT) gwt-superdev +# Run web container for debugging UTGB +container: + $(SBT) "~; container:start; container:reload /" diff --git a/development.md b/development.md index 9207ffe9..5e5435f7 100644 --- a/development.md +++ b/development.md @@ -4,6 +4,16 @@ * Java7 (JDK) +### Creating IntelliJ project files + + ./sbt gen-idea + + +### Creating Eclipse project files + + + ./sbt eclipse + ### Developing UTGB with GWT super-dev mode @@ -25,11 +35,11 @@ - Open http://localhost:8080/gwt, then click "Dev Mode On". - If you need to use 192.xx.xx.xx address to access GWT pages, run gwt-superdev mode with -Dgwt.expose=true option + If you need to use 192.xx.xx.xx address to access GWT pages, run gwt-superdev mode with -Dgwt.expose option - ./sbt gwt-superdev -Dgwt.expose=true + ./sbt gwt-superdev -Dgwt.expose - You also need to copy bookmarklet from http://192.xx.xx.xx:9876 since it becomes different when using http://localhost:9876 + You also need to copy bookmarklet from http://192.xx.xx.xx:9876 since it becomes different from when using http://localhost:9876 * Install utgb command diff --git a/project/plugins.sbt b/project/plugins.sbt index fc2c119b..881e2e11 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,7 @@ addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1") +addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0") + addSbtPlugin("com.github.gseitz" % "sbt-release" % "0.7.1") addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.3.1")