Skip to content

Commit

Permalink
add get version script
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Feb 3, 2025
1 parent 4cfff43 commit b942903
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
id: version
shell: cmd
run: |
for /f tokens^=1^,2^ delims^=^" %%i in (SharedAssemblyInfo.cs) do @if "%%i"=="[assembly: AssemblyVersion(" echo version=%%j>> %GITHUB_OUTPUT%
perl -ne "print """rdmpversion=""".$1."""\n""" if /version>(.+)</i" RDMP\directory.build.props >>%GITHUB_OUTPUT%
getversions >> %GITHUB_OUTPUT%
- name: Install MS SQL 2019
uses: crazy-max/ghaction-chocolatey@v3
with:
Expand Down
17 changes: 3 additions & 14 deletions Rdmp.Dicom/Extraction/DicomTagToCSV.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
using Amazon.SSOOIDC.Internal;
using CsvHelper;
using CsvHelper;
using FellowOakDicom;
using NPOI.HPSF;
using Org.BouncyCastle.Tls;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.DataExport.DataExtraction.Commands;
using Rdmp.Core.DataFlowPipeline;
using Rdmp.Core.DataFlowPipeline.Requirements;
using Rdmp.Core.Repositories.Construction;
using Rdmp.Core.ReusableLibraryCode.Checks;
using Rdmp.Core.ReusableLibraryCode.Progress;
using Rdmp.Dicom.Extraction.FoDicomBased;
using Rdmp.Dicom.Extraction.FoDicomBased.DirectoryDecisions;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terminal.Gui;

namespace Rdmp.Dicom.Extraction
{
Expand Down Expand Up @@ -61,7 +52,6 @@ public void Dispose(IDataLoadEventListener listener, Exception pipelineFailureEx

public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener listener, GracefulCancellationToken cancellationToken)
{
//Things we ignore, Lookups, SupportingSql etc
if (_extractCommand == null)
{
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Information, "Ignoring non dataset command "));
Expand All @@ -86,7 +76,6 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener

var dicomFilePaths = new AmbiguousFilePath(ArchiveRootIfAny, dicomFiles).GetDataset(FileFetchRetryLimit, FileFetchRetryTimeout, listener);
var destinationDirectory = new DirectoryInfo(Path.Combine(_extractCommand.GetExtractionDirectory().FullName));
listener.OnNotify(this, new NotifyEventArgs(ProgressEventType.Warning, $"{destinationDirectory}"));

foreach (var dcm in dicomFilePaths)
{
Expand All @@ -98,8 +87,8 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener
var sw = new StreamWriter(filepath);
using var w = new CsvWriter(sw, System.Globalization.CultureInfo.InvariantCulture);
w.WriteRecords(
DicomFile.Open(dcm.Item1, FileReadOption.ReadAll).Dataset.SelectMany(t => Entry.ProcessTag(dcm.Item1, t))
);
DicomFile.Open(dcm.Item1, FileReadOption.ReadAll).Dataset.SelectMany(t => Entry.ProcessTag(dcm.Item1, t))
);
}
catch (Exception e)
{
Expand Down
12 changes: 12 additions & 0 deletions getversions.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/perl -w

use strict;

open my $rdmp, '<', "RDMP/directory.build.props" or die "rdmp:$!\n";
while(<$rdmp>) {
print "rdmpversion=$1\n" if /<version>([^<]+)</i;
}
open my $assembly, '<', "SharedAssemblyInfo.cs" or die "SharedAssemblyInfo.cs:$1\n";
while(<$assembly>) {
print "version=$1\n" if /AssemblyInformationalVersion\("([^\"]+)"\)/;
}

0 comments on commit b942903

Please sign in to comment.