From 3a8ffb4e5c7f28e4a4a39cc8b076deb3649fcaaf Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Mon, 12 Sep 2022 21:36:46 +0300 Subject: [PATCH] #5 l3build --- .rultor.yml | 17 +++++++++++++++++ Makefile | 22 +++++++++++----------- build.lua | 21 +++++++++++++++++++++ clicks.sty | 10 +++++++--- 4 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 .rultor.yml create mode 100644 build.lua diff --git a/.rultor.yml b/.rultor.yml new file mode 100644 index 0000000..f4910fc --- /dev/null +++ b/.rultor.yml @@ -0,0 +1,17 @@ +docker: + image: yegor256/rultor-image:1.13.0 +install: |- + sudo apt-get install -y python3-pygments + sudo pip3 install pygments + sudo tlmgr option repository ctan + sudo gem install texsc:0.6.0 + sudo gem install texqc:0.6.0 + sudo apt-get install -y aspell + sudo tlmgr --verify-repo=none update --self + sudo tlmgr --verify-repo=none install l3build +release: + script: |- + make VERSION=${tag} set-version + git commit -am "version set to ${tag}" + make + echo 'y' | l3build upload --halt-on-error diff --git a/Makefile b/Makefile index 548f0da..4fb65f2 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -.SHELLFLAGS = -e -x -c +.SHELLFLAGS = -e -x -c -o pipefail .ONESHELL: NAME=clicks @@ -38,6 +38,13 @@ $(NAME).pdf: $(NAME).tex $(NAME).sty texsc $< texqc --ignore 'You have requested document class' $< +set-version: + date=$$(date +%Y/%m/%d) + sed -i "s|0\.0\.0|$(version)|" $(NAME).sty + sed -i "s|00\.00\.0000|$${date}|" $(NAME).sty + sed -i "s|0\.0\.0|$(version)|" $(NAME).tex + sed -i "s|00\.00\.0000|$${date}|" $(NAME).tex + zip: $(NAME).pdf $(NAME).sty rm -rf package mkdir package @@ -45,24 +52,17 @@ zip: $(NAME).pdf $(NAME).sty mkdir $(NAME) cd $(NAME) cp ../../README.md . - version=$$(curl --silent -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/yegor256/$(NAME)/releases/latest | jq -r '.tag_name') - echo "Version is: $${version}" - date=$$(date +%Y/%m/%d) - echo "Date is: $${date}" cp ../../$(NAME).sty . - gsed -i "s|0\.0\.0|$${version}|" $(NAME).sty - gsed -i "s|00\.00\.0000|$${date}|" $(NAME).sty cp ../../$(NAME).tex . - gsed -i "s|0\.0\.0|$${version}|" $(NAME).tex - gsed -i "s|00\.00\.0000|$${date}|" $(NAME).tex cp ../../.latexmkrc . latexmk -pdf $(NAME).tex rm .latexmkrc rm -rf _minted-* *.$(NAME) *.aux *.bbl *.bcf *.blg *.fdb_latexmk *.fls *.log *.run.xml *.out *.exc - cat $(NAME).sty | grep RequirePackage | gsed -e "s/.*{\(.\+\)}.*/hard \1/" > DEPENDS.txt + cat $(NAME).sty | grep RequirePackage | sed -e "s/.*{\(.\+\)}.*/hard \1/" | uniq > DEPENDS.txt cd .. zip -r $(NAME).zip * - cp $(NAME).zip ../$(NAME)-$${version}.zip + cp $(NAME).zip .. + unzip -l $(NAME).zip cd .. clean: diff --git a/build.lua b/build.lua new file mode 100644 index 0000000..d1077e7 --- /dev/null +++ b/build.lua @@ -0,0 +1,21 @@ +module = "clicks" +uploadconfig = { + update = true, + pkg = "clicks", + version = "0.0.0", + author = "Yegor Bugayenko", + uploader = "Yegor Bugayenko", + email = "yegor256@gmail.com", + note = "Bug fixes", + announcement = "Some non-critical bug fixes", + ctanPath = "/macros/latex/contrib/clicks", + bugtracker = "https://github.com/yegor256/clicks/issues", + home = "https://github.com/yegor256/clicks", + description = "With the help of this package you can simulate animation in your slide deck, making it look similar to what PowerPoint can do.", + development = "https://github.com/yegor256/clicks", + license = "mit", + summary = "Slide Deck Animation", + repository = "https://github.com/yegor256/clicks", + support = "https://github.com/yegor256/clicks", + topic = {"emulation","layout","presentation"} +} \ No newline at end of file diff --git a/clicks.sty b/clicks.sty index cdd3304..47e8fb1 100644 --- a/clicks.sty +++ b/clicks.sty @@ -37,19 +37,23 @@ \newcounter{minutes} -% Print the content as is +% Print the content as is. \makeatletter\newcommand\print[1]{% \gappto\clicks@body{{#1\par}}% }\makeatother +% Flush the page: print the entire content. \makeatletter\newcommand\flush[1][1]{% - \clicks@flush% - \renewcommand*\clicks@body{}% + \ifx\clicks@body\empty\else% + \clicks@flush% + \renewcommand*\clicks@body{}% + \fi% \ifclicks@static\else% \addtocounter{minutes}{#1}% \fi% } +% Print the content and wait for more. \makeatletter\newcommand\click[1][0]{% \ifclicks@static\else% \addtocounter{minutes}{#1}%