From c2b2f162593fe2c2cfae69de776abd00f3ab4956 Mon Sep 17 00:00:00 2001 From: Martijn Visser Date: Wed, 31 Jan 2024 21:58:30 +0100 Subject: [PATCH] Fold create_binaries into root project Just like #1014 --- .github/workflows/core_compat_helper.yml | 2 -- Manifest.toml | 8 +------- Project.toml | 10 +++++++++- build/create_binaries/Project.toml | 21 --------------------- build/create_binaries/build.jl | 9 ++++++++- build/create_binaries/precompile.jl | 2 +- build/ribasim_cli/README.md | 2 +- core/src/main.jl | 1 + docs/src/docs.jl | 4 ---- 9 files changed, 21 insertions(+), 38 deletions(-) delete mode 100644 build/create_binaries/Project.toml delete mode 100644 docs/src/docs.jl diff --git a/.github/workflows/core_compat_helper.yml b/.github/workflows/core_compat_helper.yml index 6db7c8918..5419c932b 100644 --- a/.github/workflows/core_compat_helper.yml +++ b/.github/workflows/core_compat_helper.yml @@ -39,8 +39,6 @@ jobs: import CompatHelper CompatHelper.main(; subdirs=[ "core", - "docs", - "build/create_binaries", "build/libribasim", "build/ribasim_cli" ]) diff --git a/Manifest.toml b/Manifest.toml index f161f91e0..ca3c355ee 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.0" manifest_format = "2.0" -project_hash = "1a68754569dae741c9232c9ae2db3512f52c2b80" +project_hash = "b7b3a6a72e674f9d721af279d67faf1f8110aa05" [[deps.ADTypes]] git-tree-sha1 = "41c37aa88889c171f1300ceac1313c06e891d245" @@ -1656,12 +1656,6 @@ git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" version = "1.5.5+0" -[[deps.create_binaries]] -deps = ["Artifacts", "LibGit2", "PackageCompiler", "TOML", "TimeZones"] -path = "build/create_binaries" -uuid = "3cfb6a46-05f0-43df-bb16-bf763deb14b4" -version = "0.1.0" - [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" diff --git a/Project.toml b/Project.toml index ec9276c94..c0bfb53f1 100644 --- a/Project.toml +++ b/Project.toml @@ -4,6 +4,7 @@ description = "Meta-project used to share the Manifest of Ribasim and its depend [deps] Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45" +Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" BasicModelInterface = "59605e27-edc0-445a-b93d-c09a3a50b330" Configurations = "5218b696-f38b-4ac9-8b61-a12ec717816d" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" @@ -16,24 +17,27 @@ Infiltrator = "5903a43b-9cc3-4c30-8d17-598619ec4e9b" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" Legolas = "741b9549-f6ed-4911-9fbf-4a1c0c97f0cd" +LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" MarkdownTables = "1862ce21-31c7-451e-824c-f20fa3f90fa2" MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Ribasim = "aac5e3d9-0b8f-4d4f-8241-b1a7a9632635" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" TestEnv = "1e6cf692-eddd-4d53-88a5-2d735e33781b" TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" -create_binaries = "3cfb6a46-05f0-43df-bb16-bf763deb14b4" libribasim = "f319f290-633d-4573-adfe-d6d5548b6388" ribasim_cli = "e45c999e-e944-4589-a8e6-7d0b7a60140a" [compat] +Artifacts = "<0.0.1,1" Configurations = "0.17" DataFrames = "1" Dates = "<0.0.1,1" @@ -43,7 +47,11 @@ IJulia = "1" InteractiveUtils = "<0.0.1,1" JSON3 = "1.12" Legolas = "0.5" +LibGit2 = "<0.0.1,1" Logging = "<0.0.1,1" MarkdownTables = "1" OrderedCollections = "1.6" +PackageCompiler = "2" +TimeZones = "=1.14.0, 1" +TOML = "<0.0.1,1" julia = "1.10" diff --git a/build/create_binaries/Project.toml b/build/create_binaries/Project.toml deleted file mode 100644 index aef92c80d..000000000 --- a/build/create_binaries/Project.toml +++ /dev/null @@ -1,21 +0,0 @@ -name = "create_binaries" -uuid = "3cfb6a46-05f0-43df-bb16-bf763deb14b4" -authors = ["Deltares and contributors "] -description = "Build Ribasim binaries with PackageCompiler" -manifest = "../../Manifest.toml" -version = "0.1.0" - -[deps] -Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" -LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" -PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d" -TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53" - -[compat] -Artifacts = "<0.0.1,1" -LibGit2 = "<0.0.1,1" -PackageCompiler = "2" -TOML = "<0.0.1,1" -TimeZones = "=1.14.0, 1" -julia = "1.10" diff --git a/build/create_binaries/build.jl b/build/create_binaries/build.jl index 9c27c6e84..f19181825 100644 --- a/build/create_binaries/build.jl +++ b/build/create_binaries/build.jl @@ -1,4 +1,11 @@ -using create_binaries +using Artifacts +using PackageCompiler +using TOML +using LibGit2 + +include("src/add_metadata.jl") +include("src/create_app.jl") +include("src/create_lib.jl") """ Build the Ribasim CLI, libribasim, or both, using PackageCompiler. diff --git a/build/create_binaries/precompile.jl b/build/create_binaries/precompile.jl index 73cd6c6f2..098e14760 100644 --- a/build/create_binaries/precompile.jl +++ b/build/create_binaries/precompile.jl @@ -4,4 +4,4 @@ using Ribasim, Dates, TOML toml_path = normpath(@__DIR__, "../../generated_testmodels/basic/ribasim.toml") -Ribasim.run(toml_path) +Ribasim.main(toml_path) diff --git a/build/ribasim_cli/README.md b/build/ribasim_cli/README.md index b51c5e27f..bc046000c 100644 --- a/build/ribasim_cli/README.md +++ b/build/ribasim_cli/README.md @@ -13,7 +13,7 @@ If you have installed Julia and Ribasim, a simulation can also be started from t line as follows: ``` -julia --eval 'using Ribasim; Ribasim.run("path/to/model/ribasim.toml")' +julia --eval 'using Ribasim; Ribasim.main("path/to/model/ribasim.toml")' ``` With a Ribasim CLI build this becomes: diff --git a/core/src/main.jl b/core/src/main.jl index fb621c0e9..3a02608e3 100644 --- a/core/src/main.jl +++ b/core/src/main.jl @@ -8,6 +8,7 @@ main(toml_path::AbstractString)::Cint = main([toml_path]) """ main(ARGS::Vector{String})::Cint + This is the main entry point of the application. Performs argument parsing and sets up logging for both terminal and file. Calls Ribasim.run() and handles exceptions to convert to exit codes. diff --git a/docs/src/docs.jl b/docs/src/docs.jl deleted file mode 100644 index 12701a5c9..000000000 --- a/docs/src/docs.jl +++ /dev/null @@ -1,4 +0,0 @@ -__precompile__(false) - -# This is not really a package, but needs to be set up like one so we can run -# `dev build/create_binaries` from the root project.