From 63bb8cc8079cfeb044a2a147a2cbee62bd1b2902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Thu, 18 Jun 2015 18:48:31 +0200 Subject: [PATCH] Add new options, rename some Modules options have been capitalized. "project's name" was renamed to "project's title". Many options to set global variables were added. "--clean" option was reimplemented. --- Makefile | 2 +- README.md | 44 +++++++++++++++++++++++-------------- love-release.1 | 55 +++++++++++++++++++++++++++++----------------- love-release.sh | 24 +++++++++++++------- scripts/android.sh | 4 ++-- scripts/debian.sh | 4 ++-- scripts/macosx.sh | 4 ++-- scripts/windows.sh | 4 ++-- 8 files changed, 87 insertions(+), 54 deletions(-) diff --git a/Makefile b/Makefile index 45e5406..42cb3cc 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ embedded: clean if [[ -n $$long && $${long: -1} != ',' ]]; then long="$${long},"; fi; \ sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \ -e 's/EMBEDDED=false/EMBEDDED=true/' \ - -e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release' + -e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release.sh' chmod 0775 '$(BUILD_DIR)/love-release.sh' rm -rf '$(BUILD_DIR)/tmp' diff --git a/README.md b/README.md index dd62e5b..fe0f398 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ make embedded To remove love-release, if you haven't changed the default installation directories, run `make remove`. ### SYNOPSIS -`love-release.sh [-adlmw] [-n project_name] [-r release_dir] [-v love_version] [FILES...]` +`love-release.sh [-ADLMW] [-t project_title] [-r release_dir] [-l love_version] [FILES...]` ### DESCRIPTION love-release.sh can be used to generate Love 2D game applications @@ -40,7 +40,7 @@ See the `conf.lua` file included to see how configuration works. `--help` Print this longer help #### OPERATING SYSTEMS -`-a` Create an Android package. +`-A` Create an Android package. In order to create an Android package, you must have installed the Android SDK. See [Building LÖVE for Android](https://bitbucket.org/MartinFelis/love-android-sdl2/wiki/Building_L%C3%96VE_for_Android_-_Linux), but there is no need to install the [LÖVE port to Android](https://bitbucket.org/MartinFelis/love-android-sdl2), @@ -48,43 +48,53 @@ See the `conf.lua` file included to see how configuration works. You also might want to provide more informations about it. See the ANDROID section below. -`-d` Create a deb package. Aimed at Debian and Ubuntu derivatives. +`-D` Create a deb package. Aimed at Debian and Ubuntu derivatives. In order to create a Debian package, you must provide more informations about it. See the DEBIAN section below. -`-l` Create a plain Love file. It is just a zip of your sources, renamed in \*.love. +`-L` Create a plain Love file. It is just a zip of your sources, renamed in \*.love. Mostly aimed at Linux players or developers and the most common distribution process. -`-m` Create MacOS application. +`-M` Create MacOS application. Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. If you are targeting one of these, your project must be developped with Love 0.8.0 or lower. Depending on the Love version used, the script will choose which one, between x64 only or Universal Build to create. -`-w` Create Windows application. +`-W` Create Windows application. Starting with Love 0.8.0, a release is specially available for Windows x64. If you are targeting one of these, your project must be developed with Love 0.8.0 or newer. Remember that x86 is always backwards compatible with x64. Depending on the Love version used, the script will choose which one, between x64 and x86 or x86 only to create. -`-w32` Create Windows x86 executable only -`-w64` Create Windows x64 executable only +`-W32` Create Windows x86 executable only +`-W64` Create Windows x64 executable only #### PROJECT OPTIONS -`-n` Set the projects name. By default, the name of the current directory is used. +`-a, --author` Set the project's author. -`-r` Set the release directory. By default, a subdirectory called releases is created. +`-d, --description` Set the project's description. -`-v` Love version. Default is 0.9.1. - Starting with Love 0.8.0, a release is specially available for Windows x64. - Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. +`-e, --email` Set the author's email. + +`-i, --icon` Path to icons. + +`-l, --love` Love version. Default is 0.9.2. + Starting with Love 0.8.0, a release is specially available for Windows x64. + Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. + +`-p, --pkg` Set the project's identity. + +`-r, --release` Set the release directory. By default, a subdirectory called releases is created. + +`-t, --title` Set the project's title. By default, the name of the current directory is used. + +`-u, --url` Set the project's homepage. + +`-v, --version` Set your project's version. `-x` Exclude file or directory. -`--description` Set the description of your project. - -`--homepage` Set the homepage of your project. - #### WINDOWS You can create an installer. If you don’t, you will have zip of a folder containing your game executable and its dlls. diff --git a/love-release.1 b/love-release.1 index 2982561..f62deeb 100644 --- a/love-release.1 +++ b/love-release.1 @@ -3,7 +3,7 @@ love-release.sh \- Bash script to generate Love 2D game releases .SH SYNOPSIS .B love\-release.sh -[\fB\-adlmw\fR] [\fB\-n\fR \fIproject_name\fR] [\fB\-r\fR \fIrelease_dir\fR] [\fB\-v\fR \fIlove_version\fR] [\fIFILES...\fR] +[\fB\-ADLMW\fR] [\fB\-t\fR \fIproject_title\fR] [\fB\-r\fR \fIrelease_dir\fR] [\fB\-l\fR \fIlove_version\fR] [\fIFILES...\fR] .SH DESCRIPTION .B love-release.sh can be used to generate Love 2D game applications @@ -25,7 +25,7 @@ Print a short help Print this longer help .SH OPERATING SYSTEMS .TP -.B \-a +.B \-A Create an Android package. In order to create an Android package, you must have installed the Android SDK, but there is no need to install the LÖVE port to Android, @@ -33,23 +33,23 @@ as the script will handle this by itself. You also might want to provide more informations about it. See the ANDROID section below. .TP -.B \-d +.B \-D Create a deb package. Aimed at Debian and Ubuntu derivatives. In order to create a Debian package, you must provide more informations about it. See the DEBIAN section below. .TP -.B \-l +.B \-L Create a plain Love file. It is just a zip of your sources, renamed in \fI*.love\fR. Mostly aimed at Linux players or developers and the most common distribution process. .TP -.B \-m +.B \-M Create MacOS application. Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. If you are targeting one of these, your project must be developed with Love 0.8.0 or lower. Depending on the Love version used, the script will choose which one, between x64 only or Universal Build to create. .TP -.BR \-w \", \" \-w32 \", \" \-w64 +.BR \-W Create Windows application. Starting with Love 0.8.0, a release is specially available for Windows x64. If you are targeting one of these, your project must be developed with Love 0.8.0 or newer. @@ -57,32 +57,47 @@ Remember that x86 is always backwards compatible with x64. Depending on the Love version used, the script will choose which one, between x64 and x86 or x86 only to create. .br -.B \-w32 +.B \-W32 Create Windows x86 executable only. .br -.B \-w64 +.B \-W64 Create Windows x64 executable only. .SH PROJECT OPTIONS .TP -.B \-n \fIproject-name\fR -Set the projects name. By default, the name of the current directory is used. +.B \-a, \-\-author \fIauthor\fR +Set the project's author. .TP -.B \-r \fIrelease-dir\fR -Set the release directory. By default, a subdirectory called releases is created. +.B \-d, \-\-description \fIdescription\fR +Set the project's description. .TP -.B \-v \fIversion\fR -Love version. Default is 0.9.1. +.B \-e, \-\-email \fIemail\fR +Set the author's email. +.TP +.B \-i, \-\-icon \fIicon\fR +Path to icons. +.TP +.B \-l, \-\-love \fIlove\fR +Love version. Default is 0.9.2. Starting with Love 0.8.0, a release is specially available for Windows x64. Starting with Love 0.9.0, Love no longer supports old x86 Macintosh. .TP +.B \-p, \-\-pkg \fIidentity\fR +Set the project's identity. +.TP +.B \-r, \-\-release \fIrelease-dir\fR +Set the release directory. By default, a subdirectory called releases is created. +.TP +.B \-t, \-\-title \fItitle\fR +Set the project's title. By default, the name of the current directory is used. +.TP +.B \-u, \-\-url \fIurl\fR +Set your project's homepage. +.TP +.B \-v, \-\-version \fIversion\fR +Set the version for your project. +.TP .B \-x \fIfile\fR|\fIdirectory\fR Exclude file or directory. -.TP -.B \-\-description \fIdescription\fR -Set the description of your project. -.TP -.B \-\-homepage \fIurl\fR -Set the homepage of your project. .SH WINDOWS You can create an installer. If you don’t, you will have zip of a folder containing your game executable and its dlls. diff --git a/love-release.sh b/love-release.sh index 2ba5444..56d5471 100755 --- a/love-release.sh +++ b/love-release.sh @@ -243,7 +243,7 @@ short_help () { Usage: love-release.sh [options...] [files...] Options: -h Print short help - -n Set the project's name + -t Set the project's title -r <release> Set the release directory -v <version> Set the LÖVE version EOF @@ -368,18 +368,26 @@ RELEASE_DIR=releases CACHE_DIR=~/.cache/love-release FILES=() -OPTIONS="lhn:r:v:" -LONG_OPTIONS="" +OPTIONS="La:d:e:hi:l:p:r:t:u:v:" +LONG_OPTIONS="author:,clean,description:,email:,help,icon:,love:,pkg:,release:,title:,url:,version:" ARGS=$(getopt -o "$OPTIONS" -l "$LONG_OPTIONS" -n 'love-release' -- "$@") if (( $? != 0 )); then short_help; exit_module "options"; fi eval set -- "$ARGS" while true; do case "$1" in - -n ) TITLE="$2"; shift 2 ;; - -r ) RELEASE_DIR="$2"; shift 2 ;; - -v ) if ! gen_version "$2"; then exit_module "version"; fi; shift 2 ;; - -h ) short_help; exit 0 ;; + -a|--author ) AUTHOR="$2"; shift 2 ;; + --clean ) rm -rf "$CACHE_DIR"; shift ;; + -d|--description ) DESCRIPTION="$2"; shift 2 ;; + -e|--email ) EMAIL="$2"; shift 2 ;; + -h|--help ) short_help; exit 0 ;; + -i|--icon ) ICON="$2"; shift 2 ;; + -l|--love ) if ! gen_version "$2"; then exit_module "version"; fi; shift 2 ;; + -p|--pkg ) IDENTITY="$2"; shift 2 ;; + -r|--release ) RELEASE_DIR="$2"; shift 2 ;; + -t|--title ) TITLE="$2"; shift 2 ;; + -u|--url ) URL="$2"; shift 2 ;; + -v|--version ) GAME_VERSION="$2"; shift 2 ;; -- ) shift; break ;; * ) shift ;; esac @@ -406,7 +414,7 @@ fi ( - (init_module "LÖVE" "love" "l") + (init_module "LÖVE" "love" "L") if [[ $? -eq 0 || $DEFAULT_MODULE == true ]]; then init_module "LÖVE" "default" create_love_file 9 diff --git a/scripts/android.sh b/scripts/android.sh index 4930136..604fe40 100644 --- a/scripts/android.sh +++ b/scripts/android.sh @@ -1,6 +1,6 @@ # Android debug package -init_module "Android" "android" "a" -OPTIONS="a" +init_module "Android" "android" "A" +OPTIONS="A" LONG_OPTIONS="" diff --git a/scripts/debian.sh b/scripts/debian.sh index 546a514..a5029a9 100644 --- a/scripts/debian.sh +++ b/scripts/debian.sh @@ -1,6 +1,6 @@ # Debian package -init_module "Debian" "debian" "d" -OPTIONS="d" +init_module "Debian" "debian" "D" +OPTIONS="D" LONG_OPTIONS="" diff --git a/scripts/macosx.sh b/scripts/macosx.sh index 9021b20..647f760 100644 --- a/scripts/macosx.sh +++ b/scripts/macosx.sh @@ -1,6 +1,6 @@ # Mac OS X -init_module "Mac OS X" "osx" "m" -OPTIONS="m" +init_module "Mac OS X" "osx" "M" +OPTIONS="M" LONG_OPTIONS="" diff --git a/scripts/windows.sh b/scripts/windows.sh index d6e8426..d2d1e84 100644 --- a/scripts/windows.sh +++ b/scripts/windows.sh @@ -1,6 +1,6 @@ # Windows -init_module "Windows" "windows" "w" -OPTIONS="w" +init_module "Windows" "windows" "W" +OPTIONS="W" LONG_OPTIONS=""