Skip to content

Commit

Permalink
Merge pull request #9 from nfdi4plants/arctrl
Browse files Browse the repository at this point in the history
Baseline functionality for transition to ARCtrl
  • Loading branch information
HLWeil authored Oct 6, 2023
2 parents 9625b91 + 7d65d95 commit f3eda8e
Show file tree
Hide file tree
Showing 71 changed files with 1,798 additions and 811 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,5 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

**/TestResults/**
64 changes: 37 additions & 27 deletions arcIO.NET.sln → ARCtrl.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "arcIO.NET", "src\arcIO.NET\arcIO.NET.fsproj", "{E7921F28-FB81-4029-815D-C6974FD345EC}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Build", "build\Build.fsproj", "{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "arcIO.NET.Tests", "tests\arcIO.NET.Tests\arcIO.NET.Tests.fsproj", "{71F0320C-879D-47FA-B665-B5BD1F467F76}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E13D0F57-B0E0-4BAA-BD27-9136C8307BDA}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
build.cmd = build.cmd
global.json = global.json
LICENSE = LICENSE
README.md = README.md
RELEASE_NOTES.md = RELEASE_NOTES.md
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.NET", "src\ARCtrl.NET\ARCtrl.NET.fsproj", "{A6324D54-1D9A-4EE8-BD57-FEB59132821B}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ARCtrl.NET.Tests", "tests\ARCtrl.NET.Tests\ARCtrl.NET.Tests.fsproj", "{74227D27-9ED9-45CC-BF80-1569C80719F7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -19,18 +29,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E7921F28-FB81-4029-815D-C6974FD345EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Debug|x64.ActiveCfg = Debug|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Debug|x64.Build.0 = Debug|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Debug|x86.ActiveCfg = Debug|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Debug|x86.Build.0 = Debug|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Release|Any CPU.Build.0 = Release|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Release|x64.ActiveCfg = Release|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Release|x64.Build.0 = Release|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Release|x86.ActiveCfg = Release|Any CPU
{E7921F28-FB81-4029-815D-C6974FD345EC}.Release|x86.Build.0 = Release|Any CPU
{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -43,18 +41,30 @@ Global
{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}.Release|x64.Build.0 = Release|Any CPU
{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}.Release|x86.ActiveCfg = Release|Any CPU
{E7F453CD-BCCA-42EF-96A2-C74B9A09A593}.Release|x86.Build.0 = Release|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Debug|x64.ActiveCfg = Debug|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Debug|x64.Build.0 = Debug|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Debug|x86.ActiveCfg = Debug|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Debug|x86.Build.0 = Debug|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Release|Any CPU.Build.0 = Release|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Release|x64.ActiveCfg = Release|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Release|x64.Build.0 = Release|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Release|x86.ActiveCfg = Release|Any CPU
{71F0320C-879D-47FA-B665-B5BD1F467F76}.Release|x86.Build.0 = Release|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Debug|x64.ActiveCfg = Debug|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Debug|x64.Build.0 = Debug|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Debug|x86.ActiveCfg = Debug|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Debug|x86.Build.0 = Debug|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Release|Any CPU.Build.0 = Release|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Release|x64.ActiveCfg = Release|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Release|x64.Build.0 = Release|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Release|x86.ActiveCfg = Release|Any CPU
{A6324D54-1D9A-4EE8-BD57-FEB59132821B}.Release|x86.Build.0 = Release|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Debug|x64.ActiveCfg = Debug|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Debug|x64.Build.0 = Debug|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Debug|x86.ActiveCfg = Debug|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Debug|x86.Build.0 = Debug|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Release|Any CPU.Build.0 = Release|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Release|x64.ActiveCfg = Release|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Release|x64.Build.0 = Release|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Release|x86.ActiveCfg = Release|Any CPU
{74227D27-9ED9-45CC-BF80-1569C80719F7}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
13 changes: 13 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
### 1.0.0+72d58da (Released 2023-9-19)
* Additions:
* [[#72d58da](https://github.com/nfdi4plants/ARCtrl.NET/commit/72d58daddfdbe03f707db03bfc4edc6801dbd51b)] bump to 1.0.0-alpha2
* [[#d06e12c](https://github.com/nfdi4plants/ARCtrl.NET/commit/d06e12cb08726cdd349ab2d77db4fe1314271cca)] bump to 1.0.0-alpha1
* [[#2118bdd](https://github.com/nfdi4plants/ARCtrl.NET/commit/2118bdd326281ba955c755d77d562fa070ba9f7b)] add write function
* Bugfixes:
* [[#47011f8](https://github.com/nfdi4plants/ARCtrl.NET/commit/47011f8d30f3d72d927f4540a9515e55c0028f22)] add more contraints to getAllpaths fix #10

### 0.1.0+4145f8d (Released 2023-4-3)
* Additions:
* [[#aca980b](https://github.com/nfdi4plants/arcIO.NET/commit/aca980bef59e7b6b17b8376e83b5177cf3f442d1)] include json in converter
* [[#4145f8d](https://github.com/nfdi4plants/arcIO.NET/commit/4145f8dee6642bfef7384370750503a9d8a433a0)] setup test environmet pin dotnet version to 6.x.x update ISADotNet reference

### 0.0.6+da8c364 (Released 2023-1-26)
* Additions:
* [[#6ed4bc8](https://github.com/nfdi4plants/arcIO.NET/commit/6ed4bc840dc09e2f8dd348a79241eb64c7de8d5c)] migrate githelper and logging from arcCommander
Expand Down
4 changes: 2 additions & 2 deletions build/Build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ open ReleaseTasks
let _release =
BuildTask.createEmpty
"Release"
[clean; build; runTests; pack; buildDocs; createTag; publishNuget; releaseDocs]
[clean; build; runTests; pack; buildDocs; createTag; publishNuget]

/// Full release of nuget package, git tag, and documentation for the prerelease version.
let _preRelease =
BuildTask.createEmpty
"PreRelease"
[setPrereleaseTag; clean; build; runTests; packPrerelease; buildDocsPrerelease; createPrereleaseTag; publishNugetPrerelease; prereleaseDocs]
[setPrereleaseTag; clean; build; runTests; packPrerelease; buildDocsPrerelease; createPrereleaseTag; publishNugetPrerelease]

/// Full release of nuget package for the prerelease version.
let _releaseNoDocs =
Expand Down
4 changes: 2 additions & 2 deletions build/ProjectInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

open Fake.Core

let project = "arcIO.NET"
let project = "ARCtrl.NET"

let testProjects =
[
"tests/arcIO.NET.Tests/arcIO.NET.Tests.fsproj"
"tests/ARCtrl.NET.Tests/ARCtrl.NET.Tests.fsproj"
]

let solutionFile = $"{project}.sln"
Expand Down
26 changes: 0 additions & 26 deletions build/ReleaseTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,3 @@ let publishNugetPrerelease = BuildTask.create "PublishNugetPrerelease" [clean; b
if not result.OK then failwith "failed to push packages"
else failwith "aborted"
}

let releaseDocs = BuildTask.create "ReleaseDocs" [buildDocs] {
let msg = sprintf "release docs for version %s?" stableVersionTag
if promptYesNo msg then
Shell.cleanDir "temp"
Git.CommandHelper.runSimpleGitCommand "." (sprintf "clone %s temp/gh-pages --depth 1 -b gh-pages" projectRepo) |> ignore
Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A"
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s"
let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" stableVersionTag
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s"
Git.Branches.push "temp/gh-pages"
else failwith "aborted"
}

let prereleaseDocs = BuildTask.create "PrereleaseDocs" [buildDocsPrerelease] {
let msg = sprintf "release docs for version %s?" prereleaseTag
if promptYesNo msg then
Shell.cleanDir "temp"
Git.CommandHelper.runSimpleGitCommand "." (sprintf "clone %s temp/gh-pages --depth 1 -b gh-pages" projectRepo) |> ignore
Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A"
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s"
let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" prereleaseTag
Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s"
Git.Branches.push "temp/gh-pages"
else failwith "aborted"
}
11 changes: 9 additions & 2 deletions build/TestTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

open BlackFox.Fake
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators

open ProjectInfo
open BasicTasks

let runTests = BuildTask.create "RunTests" [clean; build] {
let runTestClean = BuildTask.create "CleanTestResults" [clean] {
!! "tests/**/TestResults"
|> Shell.cleanDirs
}

let runTests = BuildTask.create "RunTests" [clean; runTestClean; build] {
printfn $"Testprojectcount: {Seq.length testProjects}"
testProjects
|> Seq.iter (fun testProject ->
Expand All @@ -22,7 +29,7 @@ let runTests = BuildTask.create "RunTests" [clean; build] {
}

// to do: use this once we have actual tests
let runTestsWithCodeCov = BuildTask.create "RunTestsWithCodeCov" [clean; build] {
let runTestsWithCodeCov = BuildTask.create "RunTestsWithCodeCov" [clean; runTestClean; build] {
let standardParams = Fake.DotNet.MSBuild.CliArguments.Create ()
testProjects
|> Seq.iter(fun testProject ->
Expand Down
22 changes: 12 additions & 10 deletions src/arcIO.NET/arcIO.NET.fsproj → src/ARCtrl.NET/ARCtrl.NET.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,40 @@

<ItemGroup>
<Compile Include="Logging.fs" />
<Compile Include="Path.fs" />
<Compile Include="Contract.fs" />
<Compile Include="GitHelper.fs" />
<Compile Include="Workflow.fs" />
<Compile Include="Run.fs" />
<Compile Include="ProcessSequence.fs" />
<Compile Include="Assay.fs" />
<Compile Include="Study.fs" />
<Compile Include="Investigation.fs" />
<Compile Include="Arc.fs" />
<Compile Include="Converter.fs" />
</ItemGroup>

<ItemGroup />

<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300-beta.23114.3" />
<PackageReference Update="FSharp.Core" Version="7.0.400" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ISADotNet.XLSX" Version="0.7.0-preview.10" />
<PackageReference Include="ARCtrl" Version="1.0.0-alpha9" />
<PackageReference Include="FsSpreadsheet.ExcelIO" Version="4.1.0" />
<PackageReference Include="JsonDSL" Version="0.0.5" />
<PackageReference Include="LitXml" Version="0.1.0" />
<PackageReference Include="NLog" Version="5.1.2" />
</ItemGroup>

<PropertyGroup>
<Authors>nfdi4plants, Lukas Weil</Authors>
<Description>Library for easy handling of ARC folders and files and reading and writing the ISAModel behind it.</Description>
<Description>Library for easy handling of ARC folders and files with file access in .NET.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<!--<PackageProjectUrl>https://fslab.org/docs-template/</PackageProjectUrl>-->
<PackageIconUrl>https://raw.githubusercontent.com/nfdi4plants/Branding/138420e3b6f9ec9e125c1ca8840874b2be2a1262/logos/DataPLANT_logo_minimal_rounded_bg_transparent.svg</PackageIconUrl>
<PackageTags>F# FSharp dotnet .Net bioinformatics biology datascience metadata investigation study assay ISA XLSX ARC IO</PackageTags>
<RepositoryUrl>https://github.com/nfdi4plants/arcIO.NET</RepositoryUrl>
<PackageTags>F# FSharp dotnet .Net bioinformatics biology datascience metadata investigation study assay ISA XLSX ARC IO ARCtrl</PackageTags>
<PackageProjectUrl>https://github.com/nfdi4plants/ARCtrl.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/nfdi4plants/ARCtrl.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<FsDocsLicenseLink>https://github.com/nfdi4plants/arcIO.NET/blob/developer/LICENSE</FsDocsLicenseLink>
<FsDocsReleaseNotesLink>https://github.com/nfdi4plants/arcIO.NET/blob/developer/RELEASE_NOTES.md</FsDocsReleaseNotesLink>
</PropertyGroup>
</PropertyGroup>
</Project>
82 changes: 82 additions & 0 deletions src/ARCtrl.NET/Arc.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
namespace ARCtrl.NET

open ARCtrl
open Contract

[<AutoOpen>]
module ARCExtensions =

type ARC with

member this.Write(arcPath) =
this.GetWriteContracts()
|> Array.iter (Contract.fulfillWriteContract arcPath)

static member load (arcPath : string) =
let paths = Path.getAllFilePaths arcPath
let arc = ARC.fromFilePaths paths

let contracts = arc.GetReadContracts()

let fulFilledContracts =
contracts
|> Array.map (fulfillReadContract arcPath)

arc.SetISAFromContracts(fulFilledContracts,true)
arc

///// Initializes the ARC-specific folder structure.
//let initFolders (arcPath) =
// subFolderPaths
// |> List.iter (fun n ->
// let dp = Path.Combine(arcPath,n)
// let dir = Directory.CreateDirectory(dp)
// File.Create(Path.Combine(dir.FullName, ".gitkeep")).Close()
// )

/// Initializes the ARC-specific git repository.
static member initGit(workDir,?repositoryAddress : string,?branch : string) =

let log = Logging.createLogger "ArcInitGitLog"

log.Trace("Init Git repository")

let branch = branch |> Option.defaultValue "main"

try

GitHelper.executeGitCommand workDir $"init -b {branch}"

log.Trace("Add remote repository")
match repositoryAddress with
| None -> ()
| Some remote ->
GitHelper.executeGitCommand workDir $"remote add origin {remote}"
//GitHelper.executeGitCommand workDir $"branch -u origin/{branch} {branch}"

with
| e ->

log.Error($"Git could not be set up. Please try installing Git cli and run `arc git init`.\n\t{e}")

///// Initializes the ARC-specific folder structure, investigation file and git repository.
//let init (workDir : string) (identifier : string) (repositoryAddress : string option) (branch : string option) =

// let log = Logging.createLogger "ArcInitLog"

// log.Info("Start Arc Init")

// log.Trace("Create Directory")

// Directory.CreateDirectory workDir |> ignore

// log.Trace("Initiate folder structure")

// initFolders workDir

// log.Trace("Initiate investigation file")

// let inv = ISADotNet.Investigation.create(Identifier=identifier)
// Investigation.write workDir inv

// initGit workDir repositoryAddress branch
Loading

0 comments on commit f3eda8e

Please sign in to comment.