Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
2eae4d00
Commit
2eae4d00
authored
5 years ago
by
vas
Committed by
lowercasedonkey
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
port to make
parent
8c5d4097
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compile.sh
+0
-157
0 additions, 157 deletions
compile.sh
makefile
+42
-0
42 additions, 0 deletions
makefile
with
42 additions
and
157 deletions
compile.sh
deleted
100755 → 0
+
0
−
157
View file @
8c5d4097
#!/bin/bash
output
=
/dev/stdout
# displays help text
function
displayHelp
{
cat
<<
HelpText
Usage: compile.sh [OPTION]...
Options:
-d, --dry Do not compile
-g, --git Add hash of HEAD to filename
-h, --help Show this help text
-j, --java Run sanityCheck based on java (recommended)
-p, --python Run sanityCheck based on python
-q, --quiet Suppress terminal output
HelpText
}
#display an error message
function
echoError
{
echo
-e
"
\0
33[0;31m
$@
\0
33[0m"
}
#display message
function
echoMessage
{
echo
"
$1
"
>
"
${
output
}
"
}
#compile the HTML file
function
compile
{
mkdir
-p
bin
export
TWEEGO_PATH
=
devTools/tweeGo/storyFormats
TWEEGO_EXE
=
"tweego"
if
hash
$TWEEGO_EXE
2>/dev/null
;
then
echoMessage
"system tweego binary"
else
case
"
$(
uname
-m
)
"
in
x86_64|amd64
)
echoMessage
"x64 arch"
if
[
"
$(
uname
-s
)
"
=
"Darwin"
]
;
then
TWEEGO_EXE
=
"./devTools/tweeGo/tweego_osx64"
else
TWEEGO_EXE
=
"./devTools/tweeGo/tweego_nix64"
fi
;;
x86|i[3-6]86
)
echoMessage
"x86 arch"
if
[
"
$(
uname
-s
)
"
=
"Darwin"
]
;
then
TWEEGO_EXE
=
"./devTools/tweeGo/tweego_osx86"
else
TWEEGO_EXE
=
"./devTools/tweeGo/tweego_nix86"
fi
;;
*
)
echoError
"No system tweego binary found, and no precompiled binary for your platform available."
echoError
"Please compile tweego and put the executable in PATH."
exit
2
esac
fi
if
[[
"
$usehash
"
]]
;
then
HASH
=
"
$(
git rev-list
-n
1
--abbrev-commit
HEAD
)
"
$TWEEGO_EXE
-o
"bin/FC_pregmod_
${
HASH
}
_tmp.html"
src/
--head
devTools/head.html
||
build_failed
=
"true"
if
[
"
$build_failed
"
=
"true"
]
then
echoError
"Build failed."
exit
1
fi
#Make the output prettier, replacing \t with a tab and \n with a newline
sed
-i
-e
'/^<div id="store-area".*$/s/\\t/\t/g'
-e
'/^<div id="store-area".*$/s/\\n/\n/g'
"bin/FC_pregmod_
${
HASH
}
_tmp.html"
\
&&
mv
"bin/FC_pregmod_
${
HASH
}
_tmp.html"
"bin/FC_pregmod_
${
HASH
}
.html"
ln
-s
../resources bin/ 2> /dev/null
echoMessage
"Saved to bin/FC_pregmod_
$HASH
.html."
else
# Find and insert current commit
COMMIT
=
$(
git rev-parse
--short
HEAD
)
sed
-Ei
"s/build .releaseID/
\0
commit
$COMMIT
/"
src/gui/mainMenu/AlphaDisclaimer.tw
$TWEEGO_EXE
-o
"bin/FC_pregmod_tmp.html"
src/
--head
devTools/head.html
||
build_failed
=
"true"
# Revert AlphaDisclaimer for next compilation
git checkout
--
src/gui/mainMenu/AlphaDisclaimer.tw
if
[
"
$build_failed
"
=
"true"
]
then
echoError
"Build failed."
exit
1
fi
#Make the output prettier, replacing \t with a tab and \n with a newline
sed
-i
-e
'/^.*<div id="store-area".*$/s/\\t/\t/g'
-e
'/^.*<div id="store-area".*$/s/\\n/\n/g'
bin/FC_pregmod_tmp.html
\
&&
mv
bin/FC_pregmod_tmp.html bin/FC_pregmod.html
ln
-s
../resources bin/ 2> /dev/null
echoMessage
"Saved to bin/FC_pregmod.html."
fi
}
if
[[
"
$1
"
==
""
]]
;
then
#tip if no option
echoMessage
"For more options see compile.sh -h."
else
#parse options
while
[[
"
$1
"
]]
do
case
$1
in
-d
|
--dry
)
dry
=
"true"
;;
-g
|
--git
)
usehash
=
"true"
;;
-h
|
--help
)
displayHelp
exit
0
;;
-j
|
--java
)
java
=
"true"
;;
-p
|
--python
)
python
=
"true"
;;
-q
|
--quiet
)
output
=
/dev/null
;;
*
)
echoError
"Unknown argument
$1
."
displayHelp
exit
1
esac
shift
done
fi
# Run sanity check.
[
-n
"
$java
"
]
&&
./sanityCheck.sh java
[
-n
"
$python
"
]
&&
./sanityCheck.sh
#compile
if
[[
"
$dry
"
]]
;
then
echoMessage
"Dry run finished."
else
compile
echoMessage
"Compilation finished."
fi
This diff is collapsed.
Click to expand it.
makefile
0 → 100644
+
42
−
0
View file @
2eae4d00
MAKEFLAGS
+=
-r
TWEEGO
:=
""
uname
:=
$(
shell
uname
-s
)
arch
:=
$(
shell
uname
-m
)
ifeq
($(uname),Linux)
ifeq
($(arch),x86_64)
TWEEGO
:=
./devTools/tweeGo/tweego_nix64
else
TWEEGO
:=
./devTools/tweeGo/tweego_nix86
endif
else
ifeq
($(uname),Darwin)
ifeq
($(arch),x86_64)
TWEEGO
:=
./devTools/tweeGo/tweego_osx64
else
TWEEGO
:=
./devTools/tweeGo/tweego_osx86
endif
endif
all
:
bin/FC_pregmod.html bin/resources
bin/resources
:
./resources
ln
-s
$<
$@
bin/FC_pregmod.html
:
bin/FC_pregmod_tmp
./devTools/embed_favicon.py
$@
git checkout
--
src/gui/mainMenu/AlphaDisclaimer.tw
mv
$<
$@
bin/FC_pregmod_tmp
:
src/gui/mainMenu/AlphaDisclaimer.tw
$(
TWEEGO
)
-o
$@
src/
--head
devTools/head.html
src/gui/mainMenu/AlphaDisclaimer.tw
:
sed
-Ei
"s/build .releaseID/
\0
commit
$(
COMMIT
)
/"
src/gui/mainMenu/AlphaDisclaimer.tw
"
sed -Ei "
s/build .releaseID/
\0
commit
$(
COMMIT
)
/
"
$<
sanity
:
./sanityCheck.sh
jsanity
:
./sanityCheck java
.PHONY
:
all sanity jsanity
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment