Skip to content

Commit

Permalink
Refactor Makesurefile to use parameterized goals #158
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Feb 14, 2023
1 parent 89d7c22 commit 2901a6b
Showing 1 changed file with 71 additions and 61 deletions.
132 changes: 71 additions & 61 deletions Makesurefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,22 @@

echo "Please don't forget to open the release draft, edit it as needed and PUBLISH!"

@goal githubTests
@doc 'Run tests with Github actions'
./gradlew clean lexer parser compileJava compileTestJava test

@goal std.awk_variables
@depends_on std.awk_variables1
@depends_on std.awk_variables2

@goal std.awk_functions
@depends_on std.awk_numeric
@depends_on document_processed @args 'Numeric-Functions.html'
@depends_on std.awk_string
@depends_on std.awk_io
@depends_on std.awk_time
@depends_on std.awk_bitwise
@depends_on std.awk_type
@depends_on std.awk_i18n
@depends_on document_processed @args 'I_002fO-Functions.html'
@depends_on document_processed @args 'Time-Functions.html'
@depends_on document_processed @args 'Bitwise-Functions.html'
@depends_on document_processed @args 'Type-Functions.html'
@depends_on document_processed @args 'I18N-Functions.html'
@depends_on std.awk_exit
@depends_on std.awk_printf

Expand All @@ -145,40 +149,49 @@
@reached_if [[ -d temp ]]
mkdir temp

@goal string_functions_downloaded @private
@depends_on temp_folder_created
@reached_if [[ -f 'temp/String-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html -o temp/String-Functions.html

@goal numeric_functions_downloaded @private
@depends_on temp_folder_created
@reached_if [[ -f 'temp/Numeric-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/Numeric-Functions.html -o temp/Numeric-Functions.html

@goal io_functions_downloaded @private
@depends_on temp_folder_created
@reached_if [[ -f 'temp/IO-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/I_002fO-Functions.html -o temp/IO-Functions.html

@goal time_functions_downloaded @private
@depends_on temp_folder_created
@reached_if [[ -f 'temp/Time-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/Time-Functions.html -o temp/Time-Functions.html
@goal document_processed @params F
@depends_on document_downloaded @args F
awk -f gen_std.awk temp/"$F"

@goal bitwise_functions_downloaded @private
@goal document_downloaded @params F
@depends_on temp_folder_created
@reached_if [[ -f 'temp/Bitwise-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/Bitwise-Functions.html -o temp/Bitwise-Functions.html
@reached_if [[ -f "temp/$F" ]]
curl --fail https://www.gnu.org/software/gawk/manual/html_node/"$F" -o temp/"$F"

@goal type_functions_downloaded @private
@goal string_functions_downloaded @private
@depends_on temp_folder_created
@reached_if [[ -f 'temp/Type-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/Type-Functions.html -o temp/Type-Functions.html
@reached_if [[ -f 'temp/String-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html -o temp/String-Functions.html

@goal i18n_functions_downloaded @private
@depends_on temp_folder_created
@reached_if [[ -f 'temp/I18N-Functions.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/I18N-Functions.html -o temp/I18N-Functions.html
#@goal numeric_functions_downloaded @private
#@depends_on temp_folder_created
#@reached_if [[ -f 'temp/Numeric-Functions.html' ]]
# curl https://www.gnu.org/software/gawk/manual/html_node/Numeric-Functions.html -o temp/Numeric-Functions.html
#
#@goal io_functions_downloaded @private
#@depends_on temp_folder_created
#@reached_if [[ -f 'temp/IO-Functions.html' ]]
# curl https://www.gnu.org/software/gawk/manual/html_node/I_002fO-Functions.html -o temp/IO-Functions.html
#
#@goal time_functions_downloaded @private
#@depends_on temp_folder_created
#@reached_if [[ -f 'temp/Time-Functions.html' ]]
# curl https://www.gnu.org/software/gawk/manual/html_node/Time-Functions.html -o temp/Time-Functions.html
#
#@goal bitwise_functions_downloaded @private
#@depends_on temp_folder_created
#@reached_if [[ -f 'temp/Bitwise-Functions.html' ]]
# curl https://www.gnu.org/software/gawk/manual/html_node/Bitwise-Functions.html -o temp/Bitwise-Functions.html
#
#@goal type_functions_downloaded @private
#@depends_on temp_folder_created
#@reached_if [[ -f 'temp/Type-Functions.html' ]]
# curl https://www.gnu.org/software/gawk/manual/html_node/Type-Functions.html -o temp/Type-Functions.html
#
#@goal i18n_functions_downloaded @private
#@depends_on temp_folder_created
#@reached_if [[ -f 'temp/I18N-Functions.html' ]]
# curl https://www.gnu.org/software/gawk/manual/html_node/I18N-Functions.html -o temp/I18N-Functions.html

@goal sprintf1_downloaded @private
@depends_on temp_folder_created
Expand All @@ -205,36 +218,36 @@
@reached_if [[ -f 'temp/Exit-Statement.html' ]]
curl https://www.gnu.org/software/gawk/manual/html_node/Exit-Statement.html -o temp/Exit-Statement.html

@goal std.awk_numeric @private
@depends_on numeric_functions_downloaded
awk -f gen_std.awk temp/Numeric-Functions.html
#@goal std.awk_numeric @private
#@depends_on numeric_functions_downloaded
# awk -f gen_std.awk temp/Numeric-Functions.html

@goal std.awk_string @private
@depends_on string_functions_downloaded
@depends_on sprintf1_downloaded
@depends_on sprintf2_downloaded
awk -f gen_std.awk temp/String-Functions.html

@goal std.awk_io @private
@depends_on io_functions_downloaded
awk -f gen_std.awk temp/IO-Functions.html

@goal std.awk_time @private
@depends_on time_functions_downloaded
awk -f gen_std.awk temp/Time-Functions.html

@goal std.awk_bitwise @private
@depends_on bitwise_functions_downloaded
awk -f gen_std.awk temp/Bitwise-Functions.html

@goal std.awk_type @private
@depends_on type_functions_downloaded
awk -f gen_std.awk temp/Type-Functions.html

@goal std.awk_i18n @private
@depends_on i18n_functions_downloaded
awk -f gen_std.awk temp/I18N-Functions.html

#@goal std.awk_io @private
#@depends_on io_functions_downloaded
# awk -f gen_std.awk temp/IO-Functions.html
#
#@goal std.awk_time @private
#@depends_on time_functions_downloaded
# awk -f gen_std.awk temp/Time-Functions.html
#
#@goal std.awk_bitwise @private
#@depends_on bitwise_functions_downloaded
# awk -f gen_std.awk temp/Bitwise-Functions.html
#
#@goal std.awk_type @private
#@depends_on type_functions_downloaded
# awk -f gen_std.awk temp/Type-Functions.html
#
#@goal std.awk_i18n @private
#@depends_on i18n_functions_downloaded
# awk -f gen_std.awk temp/I18N-Functions.html
#
@goal std.awk_variables1 @private
@depends_on variables1_downloaded
awk -v Vars=1 -f gen_std.awk temp/User_002dmodified.html
Expand All @@ -250,6 +263,3 @@
@goal std.awk_printf @private
awk -v Stmt=printf -f gen_std.awk

@goal githubTests
@doc 'Run tests with Github actions'
./gradlew clean lexer parser compileJava compileTestJava test

0 comments on commit 2901a6b

Please sign in to comment.