Skip to content

Commit

Permalink
minor fixes (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo authored May 3, 2023
1 parent 832d8d6 commit 3cf0c4e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FMIBuild"
uuid = "226f0e26-6dd6-4589-ada7-1d32f6e1d800"
authors = ["TT <[email protected]>", "LM <[email protected]>"]
version = "0.1.14"
version = "0.1.15"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
15 changes: 7 additions & 8 deletions src/FMIBuild.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand All @@ -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,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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))"
Expand Down

2 comments on commit 3cf0c4e

@ThummeTo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/82799

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.15 -m "<description of version>" 3cf0c4e3a9f72baed0fded325f5a38e0350bc674
git push origin v0.1.15

Please sign in to comment.