summaryrefslogtreecommitdiff
path: root/2024
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2025-03-03 01:28:23 +0100
committerDJ O'Leary <dijitol@proton.me>2025-03-03 01:28:23 +0100
commit6014cbb25bfa52b7276c5e8be94aa8d26e1dc30f (patch)
treeb549e57a87af8c3140da28a2f7bcd1297502fdc1 /2024
parent6860b6e83f2c6be5e59253105cf397c5b27b1590 (diff)
feat: reorg repo
Diffstat (limited to '2024')
-rw-r--r--2024/OCaml/.env.template1
-rw-r--r--2024/OCaml/.gitignore3
-rw-r--r--2024/OCaml/Taskfile.yml62
-rw-r--r--2024/OCaml/templates/part.ml3
-rw-r--r--2024/OCaml/templates/test.ml4
5 files changed, 9 insertions, 64 deletions
diff --git a/2024/OCaml/.env.template b/2024/OCaml/.env.template
deleted file mode 100644
index 637094f..0000000
--- a/2024/OCaml/.env.template
+++ /dev/null
@@ -1 +0,0 @@
-SESSION=REPLACE_ME
diff --git a/2024/OCaml/.gitignore b/2024/OCaml/.gitignore
index a251688..a18e084 100644
--- a/2024/OCaml/.gitignore
+++ b/2024/OCaml/.gitignore
@@ -27,6 +27,3 @@ setup.log
# Local OPAM switch
_opam/
-
-.env
-.direnv
diff --git a/2024/OCaml/Taskfile.yml b/2024/OCaml/Taskfile.yml
index 067ecec..1d8a89e 100644
--- a/2024/OCaml/Taskfile.yml
+++ b/2024/OCaml/Taskfile.yml
@@ -1,70 +1,28 @@
# https://taskfile.dev
-version: '3'
-
+version: "3"
vars:
PROJECT_NAME: AoC_2024
- YEAR: 2024
- ASSET_DIR: input
- SRC_DIR: lib
- SRC_TEMPLATE: part.ml
- TEST_DIR: test
- TEST_TEMPLATE: test.ml
-
-dotenv: ['.env']
-
tasks:
default:
- desc: "Prints this message"
+ desc: Prints this message
cmds:
- cmd: task --list-all
-
- day:setup:
- desc: "Creates the files needed to solve a day of Advent of Code"
- requires:
- vars:
- - DAY
- vars:
- FORMATTED_DAY: "{{if (lt (atoi .DAY) 10)}}0{{.DAY}}{{else}}{{.DAY}}{{end}}"
- cmds:
- - cmd: mkdir --parents {{ .SRC_DIR }}/day_{{ .FORMATTED_DAY }}
- - cmd: cp templates/{{.SRC_TEMPLATE}} {{.SRC_DIR}}/day_{{.FORMATTED_DAY}}/part_01.ml
- - cmd: mkdir --parents {{ .TEST_DIR }}
- - cmd: cp templates/{{.TEST_TEMPLATE}} {{.TEST_DIR}}/day_{{.FORMATTED_DAY}}_part_01.ml
- - task: fetch-input
- - task: build
- silent: true
-
- fetch-input:
- desc: "Fetches your input from adventofcode.com for the specified day"
- internal: true
- requires:
- vars:
- - DAY
- vars:
- URI: https://adventofcode.com/{{ .YEAR }}/day/{{.DAY}}/input
- FORMATTED_DAY: "{{if (lt (atoi .DAY) 10)}}0{{.DAY}}{{else}}{{.DAY}}{{end}}"
- cmds:
- - cmd: curl --cookie 'session={{.SESSION}}' {{.URI}} > {{.ASSET_DIR}}/day_{{.FORMATTED_DAY}}.txt
- silent: true
-
build:doc:
- desc: "Builds documentation using ocamldoc"
+ desc: Builds documentation using ocamldoc
preconditions:
- which ocamldoc
cmds:
- cmd: ocamldoc -html -d docs bin/main.ml
silent: true
-
build:
- desc: "Builds the project"
+ desc: Builds the project
preconditions:
- which dune
cmds:
- cmd: dune build
-
test:
- desc: "Runs the tests in the 'tests' directory"
+ desc: Runs the tests in the 'tests' directory
ignore_error: true
env:
OUNIT_CI: true
@@ -74,13 +32,12 @@ tasks:
- task: build
cmds:
- cmd: dune test {{.CLI_ARGS}}
-
test:watch:
- desc: "Continuously runs the tests in the 'tests' directory"
+ desc: Continuously runs the tests in the 'tests' directory
ignore_error: true
sources:
- - "lib/**/*.ml"
- - "test/**/*.ml"
+ - lib/**/*.ml
+ - test/**/*.ml
env:
OUNIT_CI: true
preconditions:
@@ -89,9 +46,8 @@ tasks:
- task: build
cmds:
- cmd: dune test --watch {{.CLI_ARGS}}
-
run:
- desc: "Runs the project"
+ desc: Runs the project
preconditions:
- which dune
deps:
diff --git a/2024/OCaml/templates/part.ml b/2024/OCaml/templates/part.ml
deleted file mode 100644
index 062c917..0000000
--- a/2024/OCaml/templates/part.ml
+++ /dev/null
@@ -1,3 +0,0 @@
-(* Day N: Part 1 *)
-
-let solve _ = ()
diff --git a/2024/OCaml/templates/test.ml b/2024/OCaml/templates/test.ml
deleted file mode 100644
index 0f50476..0000000
--- a/2024/OCaml/templates/test.ml
+++ /dev/null
@@ -1,4 +0,0 @@
-open OUnit2
-
-let tests = "test suite for day n part 1" >::: []
-let _ = run_test_tt_main tests