add image support, doc ant build tool
authorChristian Weiske <cweiske@cweiske.de>
Sun, 13 Sep 2015 20:59:12 +0000 (22:59 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 13 Sep 2015 20:59:46 +0000 (22:59 +0200)
README.rst
assets/game/.keep [deleted file]
build.xml
cleanup.sh
prepare-game.sh

index c097af46394f317f60021e1c0c41ff4f42a57d60..4b7985642ab354c9b5ed2d407b9bfaabbf99eb23 100644 (file)
@@ -22,6 +22,8 @@ Run ``prepare-game.sh``::
   Put a 732x412 image into res/drawable-xhdpi/ouya_icon.png
 
 Now adjust the launcher image ``ouya_icon.png`` and build/run it
-with the Android Developer Tools Eclipse IDE.
+with the Android Developer Tools Eclipse IDE, or via command line::
+
+  $ ant release
 
 The generated ``.apkg`` file will be located in the ``bin/`` folder.
diff --git a/assets/game/.keep b/assets/game/.keep
deleted file mode 100644 (file)
index e69de29..0000000
index 93a7cf9dbc250bb283b8926d6c752d510e9fbacb..ffafbd5185e3d9f4235206b9249d1409c54eaa61 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<project name="game_sample" default="help">
+<project name="ouya-snes-FIXME_PACKAGE" default="help">
 
     <!-- The local.properties file is created and updated by the 'android' tool.
          It contains the path to the SDK. It should *NOT* be checked into
index 5ecd8564ca3156b1199b987b60c31f461d01d4c8..31f799a9bbdec67b53cdfc4374b3c8a0ef1e3ac0 100755 (executable)
@@ -2,10 +2,9 @@
 set -e
 
 #clean up from last run
-git checkout AndroidManifest.xml res/drawable-xhdpi/ouya_icon.png
-for i in `ls assets/game`; do
-    rm assets/game/$i
-done
+git checkout AndroidManifest.xml build.xml res/drawable-xhdpi/ouya_icon.png
+
+[ -d assets/game ] && rm -r assets/game
 [ -d bin ] && rm -r bin
 [ -d gen ] && rm -r gen
 [ -d src/romlauncher ] && rm -r src/romlauncher
index be510570803e918b3614fd5094225b0d3b50cd42..c5423eb8a5cca6846e8e1643c8f7c29c0a7241f1 100755 (executable)
@@ -5,7 +5,7 @@ set -e
 ./cleanup.sh
 
 if [ $# -lt 3 ]; then
-    echo "Usage: ./prepare-game.sh title java.package path-to-game.smc"
+    echo "Usage: ./prepare-game.sh title java.package path-to-game.smc [cover.png]"
     exit
 fi
 
@@ -20,12 +20,18 @@ echo "Full package path: $fullpackage"
 echo "Game file: $filename"
 
 #prepare manifest
+sed -i\
+ -e "s/FIXME_PACKAGE/$package/" \
+ build.xml
+
+#prepare build file
 sed -i\
  -e "s/FIXME_PACKAGE/$fullpackage/" \
  -e "s/FIXME_TITLE/$title/" \
  AndroidManifest.xml
 
 #copy game
+mkdir -p assets/game
 cp "$filepath" assets/game/
 
 #prepare launcher
@@ -35,5 +41,12 @@ sed -e "s/FIXME_PACKAGE/$fullpackage/"\
  LaunchRomActivity.java.tpl\
  > src/romlauncher/$package/LaunchRomActivity.java
 
+if [ $# -gt 3 ]; then
+    image=$4
+    cp "$image" res/drawable-xhdpi/ouya_icon.png
+    echo "Image copied"
+else
+    echo "Put a 732x412 image into res/drawable-xhdpi/ouya_icon.png"
+fi
+
 echo "All prepared."
-echo "Put a 732x412 image into res/drawable-xhdpi/ouya_icon.png"