diff --git a/README.md b/README.md index 272381c..c65b42f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # arc-export Automatic building of a Docker container for exporting ARCs to Arc.json +# Develop + +use VS or VSCode tooling or run `dotnet build` or `dotnet test` from the command line. + # Setup -## local build +## local docker build ```shell docker build . -t arc-export diff --git a/build/BasicTasks.fs b/build/BasicTasks.fs deleted file mode 100644 index 53202e5..0000000 --- a/build/BasicTasks.fs +++ /dev/null @@ -1,45 +0,0 @@ -module BasicTasks - -open BlackFox.Fake -open Fake.IO -open Fake.DotNet -open Fake.IO.Globbing.Operators - -open ProjectInfo - -let setPrereleaseTag = BuildTask.create "SetPrereleaseTag" [] { - printfn "Please enter pre-release package suffix" - let suffix = System.Console.ReadLine() - prereleaseSuffix <- suffix - prereleaseTag <- (sprintf "%s-%s" release.NugetVersion suffix) - isPrerelease <- true -} - -let clean = BuildTask.create "Clean" [] { - !! "src/**/bin" - ++ "src/**/obj" - ++ "publish/" - ++ "tests/**/bin" - ++ "tests/**/obj" - ++ "pkg" - |> Shell.cleanDirs -} - -let build = BuildTask.create "Build" [clean] { - solutionFile - |> DotNet.build (fun p -> - let msBuildParams = - {p.MSBuildParams with - Properties = ([ - "warnon", "3390" - ]) - DisableInternalBinLog = true - } - { - p with - MSBuildParams = msBuildParams - - } - |> DotNet.Options.withCustomParams (Some "-tl") - ) -} diff --git a/build/Build.fs b/build/Build.fs deleted file mode 100644 index 0851db8..0000000 --- a/build/Build.fs +++ /dev/null @@ -1,19 +0,0 @@ -open BlackFox.Fake -open System.IO -open Fake.Core -open Fake.DotNet -open Fake.IO -open Fake.IO.FileSystemOperators -open Fake.IO.Globbing.Operators -open Fake.Tools - -open Helpers - -initializeContext() - -open BasicTasks -open TestTasks - -[] -let main args = - runOrDefault build args diff --git a/build/Helpers.fs b/build/Helpers.fs deleted file mode 100644 index 5dd1ed8..0000000 --- a/build/Helpers.fs +++ /dev/null @@ -1,28 +0,0 @@ -module Helpers - -open BlackFox.Fake -open Fake.Core -open Fake.DotNet - -let initializeContext () = - let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ] - Context.setExecutionContext (Context.RuntimeContext.Fake execContext) - -/// Executes a dotnet command in the given working directory -let runDotNet cmd workingDir = - let result = - DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) cmd "" - if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir - -let runOrDefault defaultTarget args = - Trace.trace (sprintf "%A" args) - try - match args with - | [| target |] -> Target.runOrDefault target - | arr when args.Length > 1 -> - Target.run 0 (Array.head arr) ( Array.tail arr |> List.ofArray ) - | _ -> BuildTask.runOrDefault defaultTarget - 0 - with e -> - printfn "%A" e - 1 \ No newline at end of file diff --git a/build/MessagePrompts.fs b/build/MessagePrompts.fs deleted file mode 100644 index afa3708..0000000 --- a/build/MessagePrompts.fs +++ /dev/null @@ -1,18 +0,0 @@ -module MessagePrompts - -let prompt (msg:string) = - System.Console.Write(msg) - System.Console.ReadLine().Trim() - |> function | "" -> None | s -> Some s - |> Option.map (fun s -> s.Replace ("\"","\\\"")) - -let rec promptYesNo msg = - match prompt (sprintf "%s [Yn]: " msg) with - | Some "Y" | Some "y" -> true - | Some "N" | Some "n" -> false - | _ -> System.Console.WriteLine("Sorry, invalid answer"); promptYesNo msg - -let releaseMsg = """This will stage all uncommitted changes, push them to the origin and bump the release version to the latest number in the RELEASE_NOTES.md file. - Do you want to continue?""" - -let releaseDocsMsg = """This will push the docs to gh-pages. Remember building the docs prior to this. Do you want to continue?""" \ No newline at end of file diff --git a/build/ProjectInfo.fs b/build/ProjectInfo.fs deleted file mode 100644 index 596874b..0000000 --- a/build/ProjectInfo.fs +++ /dev/null @@ -1,39 +0,0 @@ -module ProjectInfo - -open Fake.Core - -let project = "arc-export" - -let testProjects = - [ - "tests/ExportTests.fsproj" - ] - -let solutionFile = $"{project}.sln" - -let configuration = "Release" - -let gitOwner = "nfdi4plants" - -let gitHome = $"https://github.com/{gitOwner}" - -let projectRepo = $"https://github.com/{gitOwner}/{project}" - -let pkgDir = "pkg" - -let publishDir = "publish" - -// Create RELEASE_NOTES.md if not existing. Or "release" would throw an error. -Fake.Extensions.Release.ReleaseNotes.ensure() - -let release = ReleaseNotes.load "RELEASE_NOTES.md" - -let stableVersion = SemVer.parse release.NugetVersion - -let stableVersionTag = (sprintf "%i.%i.%i" stableVersion.Major stableVersion.Minor stableVersion.Patch ) - -let mutable prereleaseSuffix = "" - -let mutable prereleaseTag = "" - -let mutable isPrerelease = false \ No newline at end of file diff --git a/build/ReleaseNotesTasks.fs b/build/ReleaseNotesTasks.fs deleted file mode 100644 index 22d3671..0000000 --- a/build/ReleaseNotesTasks.fs +++ /dev/null @@ -1,29 +0,0 @@ -module ReleaseNotesTasks - -open Fake.Extensions.Release -open BlackFox.Fake - -/// This might not be necessary, mostly useful for apps which want to display current version as it creates an accessible F# version script from RELEASE_NOTES.md -let createAssemblyVersion = BuildTask.create "createvfs" [] { - AssemblyVersion.create ProjectInfo.project -} - -// https://github.com/Freymaurer/Fake.Extensions.Release#releaseupdate -let updateReleaseNotes = BuildTask.createFn "ReleaseNotes" [] (fun config -> - ReleaseNotes.update(ProjectInfo.gitOwner, ProjectInfo.project, config) -) - - -// https://github.com/Freymaurer/Fake.Extensions.Release#githubdraft -let githubDraft = BuildTask.createFn "GithubDraft" [] (fun config -> - - let body = "We are ready to go for the first release!" - - Github.draft( - ProjectInfo.gitOwner, - ProjectInfo.project, - (Some body), - None, - config - ) -) \ No newline at end of file diff --git a/build/TestTasks.fs b/build/TestTasks.fs deleted file mode 100644 index 3ab6c00..0000000 --- a/build/TestTasks.fs +++ /dev/null @@ -1,23 +0,0 @@ -module TestTasks - -open BlackFox.Fake -open Fake.DotNet - -open ProjectInfo -open BasicTasks - -let runTests = BuildTask.create "RunTests" [clean; build] { - testProjects - |> Seq.iter (fun testProject -> - Fake.DotNet.DotNet.test (fun testParams -> - { testParams with - Logger = Some "console;verbosity=detailed" - Configuration = DotNet.BuildConfiguration.fromString configuration - NoBuild = true - MSBuildParams = { testParams.MSBuildParams with DisableInternalBinLog = true } - } - |> DotNet.Options.withCustomParams (Some "-tl") - ) - testProject - ) -} \ No newline at end of file diff --git a/build/build.fsproj b/build/build.fsproj deleted file mode 100644 index 50076d4..0000000 --- a/build/build.fsproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - net8.0 - Exe - - - - - - - - - - - - - - - - - - - - - - - - - -