Little fixes. Description and Homepage now global.

This commit is contained in:
Antonin Décimo
2014-09-04 09:31:02 +02:00
parent bcdda5ac7e
commit 465030dbeb
7 changed files with 43 additions and 46 deletions

View File

@@ -67,6 +67,10 @@ it will automatically detect which version your project uses.
`-x` Exclude file or directory.
`--description` Set the description of your project.
`--homepage` Set the homepage of your project.
#### WINDOWS
`--win-icon` Path to an ico file to use.
@@ -75,8 +79,6 @@ it will automatically detect which version your project uses.
`--osx-maintainer-name` Set the maintainers name. Provide it for OS X CFBundleIdentifier.
#### DEBIAN
`--description` Set the description of your project.
`--homepage` Set the homepage of your project.
`--maintainer-email` Set the maintainers email.
`--deb-maintainer-name` Set the maintainers name.
`--deb-package-name` Set the name of the package and the command that will be used to launch your game.

View File

@@ -13,6 +13,12 @@ love_version="0.9.1"
; Project's name
project_name=""
; Homepage
homepage=""
; Description
description=""
[windows]
; Path to an .ico file to use
icon=""
@@ -35,12 +41,6 @@ maintainer_name=""
; Maintainer_email
maintainer_email=""
; Homepage
homepage=""
; Description
description=""
; Package name
; No spaces and no special characters except underscore. Better be lowercase.
package_name=""

View File

@@ -78,6 +78,12 @@ Starting with Love 0.9.0, Love no longer supports old x86 Macintosh.
.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
.TP
.B \-\-win\-icon \fIicon\fR
@@ -91,12 +97,6 @@ Path to an icns file to use.
Set the maintainer's name. Provide it for OS X CFBundleIdentifier.
.SH DEBIAN
.TP
.B \-\-description \fIdescription\fR
Set the description of your project.
.TP
.B \-\-homepage \fIpage\fR
Set the homepage of your project.
.TP
.B \-\-maintainer-email \fIemail\fR
Set the maintainer's email.
.TP
@@ -119,7 +119,7 @@ The name of the class that extends GameActivity.
By default it is the name of the project with 'Activity' appended,
eventual spaces and dashes replaced by underscores.
.TP
.B \-\-apk\|maintainer\-name \fIname\fR
.B \-\-apk\-maintainer\-name \fIname\fR
Set the maintainers name.
It must be only alphanumerical characters, with eventual underscores.
.TP

View File

@@ -20,7 +20,7 @@ SCRIPT_ARGS="l;"
SCRIPT_ARGS="w. win-icon: $SCRIPT_ARGS"
## Debian
SCRIPT_ARGS="d; deb-package-version: deb-maintainer-name: maintainer-email: homepage: description: deb-package-name: $SCRIPT_ARGS"
SCRIPT_ARGS="d; deb-package-version: deb-maintainer-name: maintainer-email: deb-package-name: $SCRIPT_ARGS"
## Android
SCRIPT_ARGS="a; activity: apk-package-version: apk-maintainer-name: apk-package-name: update-android; $SCRIPT_ARGS"
@@ -83,7 +83,7 @@ LOVE_GT_090=$(float_test "$LOVE_VERSION_MAJOR >= 0.9")
# Global variables
ARGS=( "$@" )
SCRIPT_ARGS="$SCRIPT_ARGS h; n: r: v: x: config: clean help"
SCRIPT_ARGS="$SCRIPT_ARGS h; n: r: v: x: config: homepage: description: clean help"
SCRIPT_ARGS=$(printf '%s\n' $SCRIPT_ARGS | sort -u)
CONFIG=false
CONFIG_FILE=config.ini
@@ -139,6 +139,12 @@ do
if [ -n "${INI__global__project_name}" ]; then
PROJECT_NAME=${INI__global__project_name}
fi
if [ -n "${INI__global__homepage}" ]; then
PROJECT_HOMEPAGE=${INI__global__homepage}
fi
if [ -n "${INI__global__description}" ]; then
PROJECT_DESCRIPTION=${INI__global__description}
fi
for option in "${EXCLUDE_CONFIG[@]}"
do
MAIN_EXCLUDE_FILES="${!option} $MAIN_EXCLUDE_FILES"
@@ -169,6 +175,10 @@ do
LOVE_GT_090=$(float_test "$LOVE_VERSION_MAJOR >= 0.9")
elif [ "$OPTOPT" = "x" ]; then
EXCLUDE_FILES="$OPTARG $EXCLUDE_FILES"
elif [ "$OPTOPT" = "homepage" ]; then
PROJECT_HOMEPAGE=$OPTARG
elif [ "$OPTOPT" = "description" ]; then
PROJECT_DESCRIPTION=$OPTARG
elif [ "$OPTOPT" = "clean" ]; then
missing_operands=false
rm -rf "$MAIN_CACHE_DIR"

View File

@@ -2,6 +2,9 @@
init_module "Android"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
ACTIVITY=$(echo $PROJECT_NAME | sed -e 's/[^a-zA-Z0-9_]/_/g')
# Configuration
if [ "$CONFIG" = true ]; then
if [ -n "${INI__android__activity}" ]; then
@@ -20,8 +23,6 @@ fi
# Options
activity_defined_argument=false
package_name_defined_argument=false
while getoptex "$SCRIPT_ARGS" "$@"
do
if [ "$OPTOPT" = "activity" ]; then
@@ -38,12 +39,6 @@ do
UPDATE_ANDROID_REPO=true
fi
done
if [ "$package_name_defined_argument" = false ]; then
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g')
fi
if [ "$activity_defined_argument" = false ]; then
ACTIVITY=$(echo $PROJECT_NAME | sed -e 's/[^a-zA-Z0-9_]/_/g')
fi
# Android
@@ -52,12 +47,12 @@ ERROR_MSG="Could not build Android package."
if [ -z "$PACKAGE_VERSION" ]; then
MISSING_INFO=1
ERROR_MSG="$ERROR_MSG
Missing project's version. Use --package-version."
Missing project's version. Use --apk-package-version."
fi
if [ -z "$MAINTAINER_NAME" ]; then
MISSING_INFO=1
ERROR_MSG="$ERROR_MSG
Missing maintainer's name. Use --maintainer-name."
Missing maintainer's name. Use --apk-maintainer-name."
fi
if [ "$MISSING_INFO" -eq 1 ]; then
exit_module "$MISSING_INFO" "$ERROR_MSG"

View File

@@ -1,17 +1,14 @@
# Debian package
init_module "Debian"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
# Configuration
if [ "$CONFIG" = true ]; then
if [ -n "${INI__debian__package_version}" ]; then
PACKAGE_VERSION=${INI__debian__package_version}
fi
if [ -n "${INI__debian__homepage}" ]; then
PROJECT_HOMEPAGE=${INI__debian__homepage}
fi
if [ -n "${INI__debian__description}" ]; then
PROJECT_DESCRIPTION=${INI__debian__description}
fi
if [ -n "${INI__debian__maintainer_name}" ]; then
MAINTAINER_NAME=${INI__debian__maintainer_name}
fi
@@ -25,15 +22,10 @@ fi
# Options
package_name_defined_argument=false
while getoptex "$SCRIPT_ARGS" "$@"
do
if [ "$OPTOPT" = "deb-package-version" ]; then
PACKAGE_VERSION=$OPTARG
elif [ "$OPTOPT" = "homepage" ]; then
PROJECT_HOMEPAGE=$OPTARG
elif [ "$OPTOPT" = "description" ]; then
PROJECT_DESCRIPTION=$OPTARG
elif [ "$OPTOPT" = "deb-maintainer-name" ]; then
MAINTAINER_NAME=$OPTARG
elif [ "$OPTOPT" = "maintainer-email" ]; then
@@ -43,9 +35,6 @@ do
package_name_defined_argument=true
fi
done
if [ "$package_name_defined_argument" = false ]; then
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g')
fi
# Debian
@@ -53,7 +42,7 @@ MISSING_INFO=0
ERROR_MSG="Could not build Debian package."
if [ -z "$PACKAGE_VERSION" ]; then
MISSING_INFO=1
ERROR_MSG="$ERROR_MSG\nMissing project's version. Use --package-version."
ERROR_MSG="$ERROR_MSG\nMissing project's version. Use --deb-package-version."
fi
if [ -z "$PROJECT_HOMEPAGE" ]; then
MISSING_INFO=1
@@ -65,7 +54,7 @@ if [ -z "$PROJECT_DESCRIPTION" ]; then
fi
if [ -z "$MAINTAINER_NAME" ]; then
MISSING_INFO=1
ERROR_MSG="$ERROR_MSG\nMissing maintainer's name. Use --maintainer-name."
ERROR_MSG="$ERROR_MSG\nMissing maintainer's name. Use --deb-maintainer-name."
fi
if [ -z "$MAINTAINER_EMAIL" ]; then
MISSING_INFO=1
@@ -133,6 +122,6 @@ cd "$RELEASE_DIR"
rm -rf $TEMP
unset PROJECT_DESCRIPTION PROJECT_HOMEPAGE MAINTAINER_NAME MAINTAINER_EMAIL PACKAGE_NAME PACKAGE_VERSION
unset MAINTAINER_NAME MAINTAINER_EMAIL PACKAGE_NAME PACKAGE_VERSION
exit_module

View File

@@ -2,6 +2,8 @@
init_module "Mac OS X"
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
# Configuration
if [ "$CONFIG" = true ]; then
if [ -n "${INI__macosx__maintainer_name}" ]; then
@@ -22,7 +24,6 @@ do
MAINTAINER_NAME=$OPTARG
fi
done
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g')
create_love_file 9