Permalink
Browse files

Added the optional install-artifacts.sh script. Updated documentation.

  • Loading branch information...
gcv committed Mar 14, 2011
1 parent 5704f9c commit 36a69060ecb8d63edc5ca925355bb259840554e2
Showing with 111 additions and 5 deletions.
  1. +14 −5 README.md
  2. +97 −0 install-artifacts.sh
View
@@ -18,8 +18,7 @@ README file tries to describe everything you need to know to use App Engine with
Clojure, but does not explain the details of App Engine semantics. Please refer
to Google's official documentation for details.
-Please read the [HISTORY](HISTORY.md) file to learn what changed in recent
-releases.
+Please read the project's HISTORY file to learn what changed in recent releases.
@@ -55,8 +54,10 @@ To use appengine-magic effectively, you need the following:
`war/WEB-INF/` directory. You should also place all static files that your
application uses in `war/`.
-Here is a sample `core.clj`, using Compojure (other Ring-compatible frameworks,
-such as [Moustache](https://github.com/cgrand/moustache), also work):
+Here is a sample `core.clj`, using
+[Compojure](https://github.com/weavejester/compojure) (other Ring-compatible
+frameworks, such as [Moustache](https://github.com/cgrand/moustache), also
+work):
(ns simple-example.core
(:use compojure.core)
@@ -78,6 +79,12 @@ such as [Moustache](https://github.com/cgrand/moustache), also work):
(ae/def-appengine-app simple-example-app #'simple-example-app-handler)
+If you wish to emit HTML or XML from your application, you should use a
+specialized Clojure server-side templating library, e.g.,
+[Enlive](https://github.com/cgrand/enlive) or
+[Hiccup](https://github.com/weavejester/hiccup). None of the appengine-magic
+examples rely on these libraries.
+
## Getting Started
@@ -97,7 +104,9 @@ functionality.
3. Edit `project.clj`: add `[appengine-magic "0.4.0-SNAPSHOT"]` to your
`:dev-dependencies`.
4. `lein deps`. This fetches appengine-magic, and makes its Leiningen plugin
- tasks available.
+ tasks available. If you already have the App Engine SDK installed locally,
+ and do not wish to wait for Maven to download it again as a dependency, you
+ may optionally run the provided `install-artifacts.sh` script first.
5. `lein appengine-new`. This sets up four files for your project: `core.clj`
(which has a sample Ring handler and uses the `def-appengine-app` macro),
`app_servlet.clj` (the entry point for the application),
View
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+
+usage() {
+ echo "$0 <appengine-sdk-directory> <version>"
+ echo " - <appengine-sdk-directory> is self-explanatory"
+ echo " - <version> is a string, such as \"1.4.2\""
+}
+
+
+script_dir="`dirname "$0" | sed -e "s#^\\([^/]\\)#${PWD}/\\1#"`" # sed makes absolute
+appengine_sdk_dir="$1"
+appengine_sdk_version="$2"
+
+if [[ -z $appengine_sdk_dir || ! -d $appengine_sdk_dir || -z $appengine_sdk_version ]]; then
+ usage
+ exit 1
+fi
+
+version=${appengine_sdk_version}
+
+appengine_mvn_group_id="com.google.appengine"
+
+repository="${HOME}/.m2/repository"
+
+
+mvn_install_plugin=org.apache.maven.plugins:maven-install-plugin:2.3.1
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/user/appengine-api-1.0-sdk-$version.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-api-1.0-sdk \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/user/appengine-api-labs-$version.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-api-labs \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/impl/appengine-api-stubs.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-api-stubs \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/impl/appengine-local-runtime.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-local-runtime \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/shared/appengine-local-runtime-shared.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-local-runtime-shared \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/testing/appengine-testing.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-testing \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository
+
+mvn ${mvn_install_plugin}:install-file \
+ -Dfile="$appengine_sdk_dir/lib/appengine-tools-api.jar" \
+ -DgroupId=$appengine_mvn_group_id \
+ -DartifactId=appengine-tools-api \
+ -Dversion=$appengine_sdk_version \
+ -Dpackaging=jar \
+ -DgeneratePom=true \
+ -DcreateChecksum=true \
+ -DlocalRepositoryPath=$repository

0 comments on commit 36a6906

Please sign in to comment.