mirror of
https://github.com/TangentFoxy/love-release.git
synced 2025-07-28 11:02:20 +00:00
9
Makefile
9
Makefile
@@ -14,10 +14,10 @@ love-release: deps clean
|
|||||||
mkdir -p '$(BUILD_DIR)'
|
mkdir -p '$(BUILD_DIR)'
|
||||||
longopt=$$(grep -m1 "LONG_OPTIONS" love-release.sh | sed -E 's/.*LONG_OPTIONS="(.*)"/\1/'); \
|
longopt=$$(grep -m1 "LONG_OPTIONS" love-release.sh | sed -E 's/.*LONG_OPTIONS="(.*)"/\1/'); \
|
||||||
for file in scripts/*.sh; do \
|
for file in scripts/*.sh; do \
|
||||||
s="$$(grep -E -m1 "^OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \
|
s="$$(grep -E -m1 "^MOD_OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \
|
||||||
short="$${short}$${s}"; \
|
short="$${short}$${s}"; \
|
||||||
s="$${s:0:1}"; \
|
s="$${s:0:1}"; \
|
||||||
ll=$$(grep -E -m1 "^LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \
|
ll=$$(grep -E -m1 "^MOD_LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \
|
||||||
long="$${long},$${s}$${longopt//,/,$$s}"; \
|
long="$${long},$${s}$${longopt//,/,$$s}"; \
|
||||||
if [[ -n $$ll ]]; then long="$${long},$${s}$${ll//,/,$$s}"; fi; \
|
if [[ -n $$ll ]]; then long="$${long},$${s}$${ll//,/,$$s}"; fi; \
|
||||||
shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\"; \
|
shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\"; \
|
||||||
@@ -47,10 +47,10 @@ embedded: clean
|
|||||||
module="$$(basename -s '.sh' "$$file")"; \
|
module="$$(basename -s '.sh' "$$file")"; \
|
||||||
content='(source <(cat <<\EndOfModule'$$'\n'"$$(cat $$file)"$$'\n''EndOfModule'$$'\n''))'$$'\n''default_module'$$'\n\n'; \
|
content='(source <(cat <<\EndOfModule'$$'\n'"$$(cat $$file)"$$'\n''EndOfModule'$$'\n''))'$$'\n''default_module'$$'\n\n'; \
|
||||||
echo "$$content" >> "$(BUILD_DIR)/tmp"; \
|
echo "$$content" >> "$(BUILD_DIR)/tmp"; \
|
||||||
s="$$(grep -E -m1 "^OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \
|
s="$$(grep -E -m1 "^MOD_OPTIONS" "$$file" | sed -E "s/OPTIONS=(['\"]?)(.*)\1/\2/")"; \
|
||||||
short="$${short}$${s}"; \
|
short="$${short}$${s}"; \
|
||||||
s="$${s:0:1}"; \
|
s="$${s:0:1}"; \
|
||||||
ll=$$(grep -E -m1 "^LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \
|
ll=$$(grep -E -m1 "^MOD_LONG_OPTIONS" "$$file" | sed -E "s/LONG_OPTIONS=(['\"]?)(.*)\1/\2/"); \
|
||||||
long="$${long},$${s}$${longopt//,/,$$s}"; \
|
long="$${long},$${s}$${longopt//,/,$$s}"; \
|
||||||
if [[ -n $$ll ]]; then long="$${long},$${s}$${ll//,/,$$s}"; fi; \
|
if [[ -n $$ll ]]; then long="$${long},$${s}$${ll//,/,$$s}"; fi; \
|
||||||
shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\"; \
|
shelp="$$shelp\\n\\ -$$(grep "init_module" $$file | sed -Ee 's/init_module //' -e 's/" "/ /g' -e "s/\"//g" | awk -F "\t" '{print($$3," ",$$1)}')\\"; \
|
||||||
@@ -106,4 +106,3 @@ remove:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf '$(BUILD_DIR)'
|
rm -rf '$(BUILD_DIR)'
|
||||||
|
|
||||||
|
@@ -51,10 +51,10 @@ For example, we could have `init_module "Android" "android" "A"`.
|
|||||||
Declare the additional options your script will be using.
|
Declare the additional options your script will be using.
|
||||||
Beware ! They are parsed by sed, so let them be simple strings at the beginning of the line.
|
Beware ! They are parsed by sed, so let them be simple strings at the beginning of the line.
|
||||||
|
|
||||||
Love-release uses GNU getopt. Short options are made of one character. Add them in the `$OPTIONS` variable. Long options can be added in the `$LONG_OPTIONS` variable, separated by a comma. Each option may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument.
|
Love-release uses GNU getopt. Short options are made of one character. Add them in the `$MOD_OPTIONS` variable. Long options can be added in the `$MOD_LONG_OPTIONS` variable, separated by a comma. Each option may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument.
|
||||||
```bash
|
```bash
|
||||||
OPTIONS="A"
|
MOD_OPTIONS="A"
|
||||||
LONG_OPTIONS="activity:,update"
|
MOD_LONG_OPTIONS="activity:,update"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Android debug package
|
# Android debug package
|
||||||
init_module "Android" "android" "A"
|
init_module "Android" "android" "A"
|
||||||
OPTIONS="A"
|
MOD_OPTIONS="A"
|
||||||
LONG_OPTIONS="activity:,update"
|
MOD_LONG_OPTIONS="activity:,update"
|
||||||
|
|
||||||
|
|
||||||
IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||||
@@ -153,4 +153,3 @@ rm -rf src/com bin gen
|
|||||||
|
|
||||||
|
|
||||||
exit_module
|
exit_module
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Debian package
|
# Debian package
|
||||||
init_module "Debian" "debian" "D"
|
init_module "Debian" "debian" "D"
|
||||||
OPTIONS="D"
|
MOD_OPTIONS="D"
|
||||||
LONG_OPTIONS=""
|
MOD_LONG_OPTIONS=""
|
||||||
|
|
||||||
|
|
||||||
IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||||
@@ -101,4 +101,3 @@ rm -rf "$TEMP"
|
|||||||
|
|
||||||
|
|
||||||
exit_module
|
exit_module
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Mac OS X
|
# Mac OS X
|
||||||
init_module "Mac OS X" "osx" "M"
|
init_module "Mac OS X" "osx" "M"
|
||||||
OPTIONS="M"
|
MOD_OPTIONS="M"
|
||||||
LONG_OPTIONS=""
|
MOD_LONG_OPTIONS=""
|
||||||
|
|
||||||
|
|
||||||
IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
IDENTITY=$(echo $TITLE | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||||
@@ -97,4 +97,3 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
exit_module
|
exit_module
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Windows
|
# Windows
|
||||||
init_module "Windows" "windows" "W"
|
init_module "Windows" "windows" "W"
|
||||||
OPTIONS="W::"
|
MOD_OPTIONS="W::"
|
||||||
LONG_OPTIONS="appid:,installer"
|
MOD_LONG_OPTIONS="appid:,installer"
|
||||||
|
|
||||||
if [[ -z $IDENTITY ]]; then
|
if [[ -z $IDENTITY ]]; then
|
||||||
IDENTITY=$(echo $IDENTITY | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
IDENTITY=$(echo $IDENTITY | sed -e 's/[^-a-zA-Z0-9_]/-/g' | tr '[:upper:]' '[:lower:]')
|
||||||
@@ -234,4 +234,3 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
exit_module
|
exit_module
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user