Skip to content

Commit

Permalink
Merge pull request #69 from ADAPT/develop
Browse files Browse the repository at this point in the history
Releasing latest dev to master
  • Loading branch information
strhea authored Apr 28, 2021
2 parents 44632be + c2320b3 commit a38ffad
Show file tree
Hide file tree
Showing 14 changed files with 200 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,6 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/

# Jetbrains Rider
.idea/
13 changes: 10 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
language: csharp
dotnet: 2.1.4

dist: bionic
env:
- FrameworkPathOverride=/usr/lib/mono/4.5/

jobs:
include:
- stage: test
- stage: Run Tests
before_install:
- wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
- sudo dpkg -i packages-microsoft-prod.deb
- sudo apt-get update
- sudo apt-get install -y dotnet-sdk-3.1
- sudo apt-get install -y dotnet-sdk-2.1
mono: none
script:
- dotnet --list-sdks
- dotnet test ./PluginTest/PluginTest.csproj -c Release
- dotnet test ./AcceptanceTest/AcceptanceTest.csproj -c Release

- stage: deploy
if: tag =~ ^v\d+\.\d+\.\d+
mono: 5.8.0
Expand Down
7 changes: 7 additions & 0 deletions ADMPlugin.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "TestUtilit
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AcceptanceTest", "AcceptanceTest\AcceptanceTest.csproj", "{B0DECFAC-9297-4764-9CE7-91D0D66276AD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{4EC051D9-5084-410F-A659-97B596975AEF}"
ProjectSection(SolutionItems) = preProject
.travis.yml = .travis.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -40,4 +45,6 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {97C57A24-3EF5-4CF0-B193-6B0E7A98234D}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
EndGlobal
5 changes: 4 additions & 1 deletion ADMPlugin/ADMPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
<PackageId>AgGateway.ADAPT.ADMPlugin</PackageId>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) AND '$(MSBuildRuntimeType)' == 'Core' AND '$(OS)' != 'Windows_NT'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AgGatewayADAPTFramework" Version="2.0.4" />
<PackageReference Include="AgGatewayADAPTFramework" Version="2.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="protobuf-net" Version="2.4.0" />
</ItemGroup>
Expand Down
30 changes: 30 additions & 0 deletions ADMPlugin/Json/NetCoreApp31CompatibleVersionConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace AgGateway.ADAPT.ADMPlugin.Json
{
public class NetCoreApp31CompatibleVersionConverter : JsonConverter<Version>
{
public override void WriteJson(JsonWriter writer, Version value, JsonSerializer serializer)
{
throw new NotImplementedException();
}

public override Version ReadJson(JsonReader reader, Type objectType, Version existingValue, bool hasExistingValue,
JsonSerializer serializer)
{
if (existingValue != null)
return existingValue;

var versionJObject = JToken.ReadFrom(reader);

if (Version.TryParse(versionJObject.ToString(), out var version))
return version;


var versionString = $"{versionJObject.Value<string>("Major")}.{versionJObject.Value<string>("Minor")}.{versionJObject.Value<string>("Build")}.{versionJObject.Value<string>("Revision")}";
return Version.Parse(versionString);
}
}
}
26 changes: 12 additions & 14 deletions ADMPlugin/Protobuf/V1/LoggedData/OperationDataType.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using ProtoBuf.Meta;

namespace AgGateway.ADAPT.ADMPlugin.Protobuf.V1.LoggedData
Expand All @@ -9,17 +6,18 @@ public static class OperationDataType
{
public static void Configure(RuntimeTypeModel model)
{
var type = model.Add(typeof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData), Constants.UseDefaults);
type.AddField(60, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.Id));
type.AddField(63, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.LoadId));
type.AddField(64, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.OperationType));
type.AddField(65, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.PrescriptionId));
type.AddField(66, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.ProductIds));
type.AddField(67, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.VarietyLocatorId));
type.AddField(68, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.WorkItemOperationId));
type.AddField(69, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.MaxDepth));
type.AddField(70, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.SpatialRecordCount));
type.AddField(551, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.EquipmentConfigurationIds));
var type = model.Add(typeof(ApplicationDataModel.LoggedData.OperationData), Constants.UseDefaults);
type.AddField(60, nameof(ApplicationDataModel.LoggedData.OperationData.Id));
type.AddField(63, nameof(ApplicationDataModel.LoggedData.OperationData.LoadId));
type.AddField(64, nameof(ApplicationDataModel.LoggedData.OperationData.OperationType));
type.AddField(65, nameof(ApplicationDataModel.LoggedData.OperationData.PrescriptionId));
type.AddField(66, nameof(ApplicationDataModel.LoggedData.OperationData.ProductIds));
type.AddField(67, nameof(ApplicationDataModel.LoggedData.OperationData.VarietyLocatorId));
type.AddField(68, nameof(ApplicationDataModel.LoggedData.OperationData.WorkItemOperationId));
type.AddField(69, nameof(ApplicationDataModel.LoggedData.OperationData.MaxDepth));
type.AddField(70, nameof(ApplicationDataModel.LoggedData.OperationData.SpatialRecordCount));
type.AddField(551, nameof(ApplicationDataModel.LoggedData.OperationData.EquipmentConfigurationIds));
type.AddField(598, nameof(ApplicationDataModel.LoggedData.OperationData.ContextItems));
}
}
}
1 change: 1 addition & 0 deletions ADMPlugin/Protobuf/V2/LoggedData/LoggedDataType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static void Configure(RuntimeTypeModel model)
type.AddField(6, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.LoggedData.SummaryId));
type.AddField(7, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.LoggedData.Notes));
type.AddField(8, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.LoggedData.OperationData));
type.AddField(22, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.LoggedData.CalibrationFactors));
type.AddField(21, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.LoggedData.Description));
}
}
Expand Down
26 changes: 12 additions & 14 deletions ADMPlugin/Protobuf/V2/LoggedData/OperationDataType.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using ProtoBuf.Meta;

namespace AgGateway.ADAPT.ADMPlugin.Protobuf.V2.LoggedData
Expand All @@ -9,17 +6,18 @@ public static class OperationDataType
{
public static void Configure(RuntimeTypeModel model)
{
var type = model.Add(typeof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData), Constants.UseDefaults);
type.AddField(1, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.Id));
type.AddField(2, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.LoadId));
type.AddField(3, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.OperationType));
type.AddField(4, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.PrescriptionId));
type.AddField(5, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.ProductIds));
type.AddField(6, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.VarietyLocatorId));
type.AddField(7, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.WorkItemOperationId));
type.AddField(8, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.MaxDepth));
type.AddField(9, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.SpatialRecordCount));
type.AddField(10, nameof(AgGateway.ADAPT.ApplicationDataModel.LoggedData.OperationData.EquipmentConfigurationIds));
var type = model.Add(typeof(ApplicationDataModel.LoggedData.OperationData), Constants.UseDefaults);
type.AddField(1, nameof(ApplicationDataModel.LoggedData.OperationData.Id));
type.AddField(2, nameof(ApplicationDataModel.LoggedData.OperationData.LoadId));
type.AddField(3, nameof(ApplicationDataModel.LoggedData.OperationData.OperationType));
type.AddField(4, nameof(ApplicationDataModel.LoggedData.OperationData.PrescriptionId));
type.AddField(5, nameof(ApplicationDataModel.LoggedData.OperationData.ProductIds));
type.AddField(6, nameof(ApplicationDataModel.LoggedData.OperationData.VarietyLocatorId));
type.AddField(7, nameof(ApplicationDataModel.LoggedData.OperationData.WorkItemOperationId));
type.AddField(8, nameof(ApplicationDataModel.LoggedData.OperationData.MaxDepth));
type.AddField(9, nameof(ApplicationDataModel.LoggedData.OperationData.SpatialRecordCount));
type.AddField(10, nameof(ApplicationDataModel.LoggedData.OperationData.EquipmentConfigurationIds));
type.AddField(11, nameof(ApplicationDataModel.LoggedData.OperationData.ContextItems));
}
}
}
6 changes: 2 additions & 4 deletions ADMPlugin/Serializers/VersionInfoSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using AgGateway.ADAPT.ADMPlugin.Json;
using AgGateway.ADAPT.ADMPlugin.Models;
using Newtonsoft.Json;

Expand Down Expand Up @@ -39,7 +37,7 @@ public AdmVersionInfo Deserialize(string dataPath)

var fileString = File.ReadAllText(filePath);

var model = JsonConvert.DeserializeObject<AdmVersionInfo>(fileString);
var model = JsonConvert.DeserializeObject<AdmVersionInfo>(fileString, new NetCoreApp31CompatibleVersionConverter());
return model;
}
}
Expand Down
6 changes: 3 additions & 3 deletions AcceptanceTest/AcceptanceTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp3.1</TargetFrameworks>
<Version>0.0.0</Version>
<NeutralLanguage></NeutralLanguage>
<Copyright>Copyright (C) 2015-19 AgGateway and ADAPT Contributors</Copyright>
Expand All @@ -13,7 +13,7 @@
<PackageId>AgGateway.ADAPT.AcceptanceTest</PackageId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AgGatewayADAPTFramework" Version="2.0.4" />
<PackageReference Include="AgGatewayADAPTFramework" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
Expand Down
6 changes: 3 additions & 3 deletions PluginTest/PluginTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFrameworks>netcoreapp2.0;netcoreapp3.1</TargetFrameworks>
<Version>0.0.0</Version>
<NeutralLanguage></NeutralLanguage>
<Copyright>Copyright (C) 2015-19 AgGateway and ADAPT Contributors</Copyright>
Expand All @@ -13,7 +13,7 @@
<PackageId>AgGateway.ADAPT.PluginTest</PackageId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AgGatewayADAPTFramework" Version="2.0.4" />
<PackageReference Include="AgGatewayADAPTFramework" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Moq" Version="4.10.1" />
<PackageReference Include="NUnit" Version="3.11.0" />
Expand Down
5 changes: 0 additions & 5 deletions PluginTest/Serializers/AdmSerializerTest.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using AgGateway.ADAPT.ADMPlugin;
using AgGateway.ADAPT.ApplicationDataModel.ADM;
using AgGateway.ADAPT.ApplicationDataModel.Equipment;
using AgGateway.ADAPT.ApplicationDataModel.LoggedData;
using AgGateway.ADAPT.ApplicationDataModel.ReferenceLayers;
using Moq;
using Newtonsoft.Json;
using NUnit.Framework;
using AgGateway.ADAPT.TestUtilities;
using AgGateway.ADAPT.ADMPlugin.Serializers;
using AgGateway.ADAPT.ADMPlugin.Models;
using AgGateway.ADAPT.ADMPlugin.Json;
Expand Down
Loading

0 comments on commit a38ffad

Please sign in to comment.