From 3cf0c4e3a9f72baed0fded325f5a38e0350bc674 Mon Sep 17 00:00:00 2001 From: ThummeTo <83663542+ThummeTo@users.noreply.github.com> Date: Wed, 3 May 2023 15:47:18 +0200 Subject: [PATCH] minor fixes (#24) --- Project.toml | 2 +- README.md | 4 ++-- src/FMIBuild.jl | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index 2b2f780..b2e524a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FMIBuild" uuid = "226f0e26-6dd6-4589-ada7-1d32f6e1d800" authors = ["TT ", "LM "] -version = "0.1.14" +version = "0.1.15" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/README.md b/README.md index 0c82943..047131c 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,12 @@ 2\. Install [*FMIBuild.jl*](https://github.com/ThummeTo/FMIBuild.jl): ```julia-repl -(@v1.6) pkg> add FMIBuild +(@v1.x) pkg> add FMIBuild ``` (3)\. If you want to check that everything works correctly, you can run the tests bundled with [*FMIBuild.jl*](https://github.com/ThummeTo/FMIBuild.jl): ```julia-repl -(@v1.6) pkg> test FMIBuild +(@v1.x) pkg> test FMIBuild ``` ## What FMI.jl-Library should I use? diff --git a/src/FMIBuild.jl b/src/FMIBuild.jl index 93200bf..de9ecdf 100644 --- a/src/FMIBuild.jl +++ b/src/FMIBuild.jl @@ -57,7 +57,7 @@ The current package is detected, duplicated and extended by the FMI-functions. T # Keyword arguments - `standalone` if the FMU should be build in standalone-mode, meaning without external dependencies to a Julia-Installation (default=`true`) - - `compress` if the FMU archive should be compressed to save disk space. On the other hand, this may enlarge loading time (default=`false`) + - `compress` if the FMU archive should be compressed to save disk space. On the other hand, this may enlarge loading time (default=`true`) - `cleanup` if the unzipped FMU archive should be deleted after creation (default=`true`) - `removeLibDependency` removes the FMIBuild.jl-dependency, so it will not be part of the resulting FMU (default=`true`) - `removeNoExportBlocks` removes the blocks marked with `### FMIBUILD_NO_EXPORT_BEGIN ###` and `### FMIBUILD_NO_EXPORT_END ###` from the `fmu_src_file`, so it will not be part of the resulting FMU (default=`true`) @@ -67,7 +67,7 @@ The current package is detected, duplicated and extended by the FMI-functions. T """ function fmi2Save(fmu::FMU2, fmu_path::String, fmu_src_file::Union{Nothing, String}=nothing; standalone=true, - compress=false, + compress=true, cleanup=true, removeLibDependency=true, removeNoExportBlocks=true, @@ -219,11 +219,11 @@ function fmi2Save(fmu::FMU2, fmu_path::String, fmu_src_file::Union{Nothing, Stri @info "[Build FMU] Adding/removing dependencies ..." currentEnv = Base.active_project() - preCompState = 1 + currentCompState = 1 try - preCompState = ENV["JULIA_PKG_PRECOMPILE_AUTO"] + currentCompState = ENV["JULIA_PKG_PRECOMPILE_AUTO"] catch e - preCompState = 1 + currentCompState = 1 end ENV["JULIA_PKG_PRECOMPILE_AUTO"] = 0 @@ -251,8 +251,8 @@ function fmi2Save(fmu::FMU2, fmu_path::String, fmu_src_file::Union{Nothing, Stri @info "[Build FMU] > Most recent version of `FMIExport` already checked out, is `$(fmiexportPath)`." else @info "[Build FMU] > Replacing `FMIExport` at `$(old_fmiexportPath)` with the current installation at `$(fmiexportPath)`." + Pkg.add(path=fmiexportPath) end - Pkg.add(path=fmiexportPath) else @info "[Build FMU] > FMU has no dependency on `FMIExport`." end @@ -275,8 +275,7 @@ function fmi2Save(fmu::FMU2, fmu_path::String, fmu_src_file::Union{Nothing, Stri end Pkg.activate(currentEnv) - #Pkg.resolve() - ENV["JULIA_PKG_PRECOMPILE_AUTO"]=preCompState + ENV["JULIA_PKG_PRECOMPILE_AUTO"] = currentCompState @info "[Build FMU] ... adding/removing dependencies done." @info "[Build FMU] ... generating new FMU source file at $(joinpath(merge_dir, fmu_src_in_merge_dir))"