Skip to content

Commit 37c915b

Browse files
fle-bachNicolas ERNY
authored andcommitted
Migrate TI ReactiveApi in .NetCore (#93)
* migrate library .net framework to .net standart 2.0 * upgrade .net framework version to 6.1 for .net standard 2.0 * modif cake for compile with .net standard * upgrade apiClientHelloWorld version 6.1 * change package with dotnet core * change img docker + name merge * backup tmp img docker compile * test img docker change * test -exclusive * change cache v2 * generate chache shasum * img .net * test with no paths... * restaure paths... * test launch after checkout * test add save_cahe with paths in build_sh_reactiveapi * test comment restore * test all run in checkout_code * back up and modif img checkout * change img checkout * change v1 to v2 cache * test restore circleci/project * cd to directory * path /home/circleci/project * test modif without exit * test if mono exist * test || cmd * test restaure packages * test change env img docker * change path ./ * change order execute * back up last commit with path /home/circleci.. * add packages.csproj * add start cake .dotnet * test find cake.dll * test .netcore * reset modif .sh and cut work yml * path for build .sh * test copy build.sh from cake.xcomponent * test find Cake.dll * test path circleci find Cake.dll * test path circleci for build.cake * delete VsixSignTool * switch TU .net FrameWork to .Net Core and reset build.sh * delete AssemblyInfo.cs tools/package.config && migrate .sh .ps1 to .NetCore * add clean .sln && modif path .sh && delete cleanSolution utilities * change directory img microsoft * change directory img microsoft other way * delete package.config app.config unused for the moment ReactiveXComponentTest * add nuget.exe installation in .ps1 .sh && add nuget.exe in env .ps1 * Test print path nuget.exe * Test print path nuget.exe wiyh $ * new download xcomponent.build.community in packages.csproj && delete download nuget.exe * change reference .dll to .csproj for reactiveXComponentTest.csproj * modif task test for build in .NetCore * change requiered reactiveapi_integrationtest && change img docker && install mono by command * add indentation name command * delete cmd sudo * add apt-get update * add -y for yes auto * update mono version * add key for install mono * change persiste docker to packaging * change path debug to release * .csproj add download all .dll and build.cake add merge all.dll in one .dll in packaging * delete reference rabbitmq in reactivexcomponentTest (ref in ReactiveXComponent) && merge build in .csproj && delete task merge .cake * modif copy .xcapi alwas ReactiveXComponentTest && Change version NSubstitute => compile TU with cake * test launch circleci... * modif files for set version build (add assembly Info Perso) * delete AssemblyInfo Test unused * modif .cproj <packagereference> to <reference> && download old version system.reactive.link * add my AssemblyInfo && download old version system.reactive.link/core/interfaces * add addin Cake.XComponent&version=6.0.0 for get function XcBuilbBuild (and other include) to compile project helloWorld * delete function BuildSolution unused (replace by cmd DotNetCoreBuild) * delete .nuspec * use startProcess for build project HelloWorld because Xcbuildbuild need mono with xcomponent(in .netFramework) project in .sh * delete assemblyInfo, remove Info to .csproj * remove info of the assemblyInfo.cs in ReactiveXComponent.csproj * remove app.config && package.config for .netcore * delete AssemblyInfo * migrate TI build in .netcore * migrate console app TI in .netcore * change img mono for img dotnet * change ^path build.cake with .netcore && change app to launch .dll and xcapi path * back path xcapifile * copy all .dll in bin/debug * unused 'as build-env'
1 parent 090ad60 commit 37c915b

File tree

11 files changed

+35
-216
lines changed

11 files changed

+35
-216
lines changed

build.cake

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ Task("All")
104104
Task("BuildHelloWorld")
105105
.Does(() =>
106106
{
107-
NuGetRestore("./docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances.sln", new NuGetRestoreSettings { NoCache = true });
108107
var exitCode = 0;
109108
var helloWorldProjectPathParam = " --project=\"./docker/integration_tests/XCProjects/HelloWorldV5/HelloWorldV5_Model.xcml\"";
110109

@@ -134,23 +133,27 @@ Task("BuildIntegrationTests")
134133
"./packaging/ReactiveXComponent.dll"
135134
};
136135

136+
var pathTIDirectory = "./docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi";
137137
var pathrxcAssembliesDirectory = "./docker/integration_tests/XCProjects/HelloWorldV5/rxcAssemblies";
138138
var rxcAssemblies = GetFiles(rxcAssembliesPatterns);
139139

140140
CreateDirectory(pathrxcAssembliesDirectory);
141141
CopyFiles(rxcAssemblies, pathrxcAssembliesDirectory);
142-
var buildSettings = new Settings { Configuration = buildConfiguration, VSVersion = vsVersion };
143142

144-
CrossPlatformBuild(@"./docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances.sln", buildSettings);
143+
DotNetCoreRestore(pathTIDirectory + "/CreateInstances.sln");
144+
DotNetCoreBuild(
145+
pathTIDirectory + "/CreateInstances.sln",
146+
new DotNetCoreBuildSettings {
147+
Configuration = buildConfiguration,
148+
});
145149
});
146150

147151
Task("PackageDockerIntegrationTests")
148152
.Does(() =>
149153
{
150154
Zip( GetXcRuntimePath().Replace("xcruntime.exe", ""), "./docker/integration_tests/dockerScripts/XCContainer/XCRuntime.zip");
151155
Zip("./docker/integration_tests/XCProjects/HelloWorldV5/xcr/xcassemblies", "./docker/integration_tests/dockerScripts/XCContainer/HelloWorldV5XCassemblies.zip");
152-
Zip("./docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/bin/" + buildConfiguration, "./docker/integration_tests/dockerScripts/AppsContainer/CreateInstanceReactiveApi.zip");
153-
156+
Zip("./docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/bin/" + buildConfiguration + "/netcoreapp2.1", "./docker/integration_tests/dockerScripts/AppsContainer/CreateInstanceReactiveApi.zip");
154157
});
155158

156159

cake.scripts/utilities.cake

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,6 @@ var FormatNugetVersion = new Func<string, string>(currentVersion =>
129129
return result;
130130
});
131131

132-
public class Settings {
133-
public string Configuration { get; set; }
134-
public string Target { get; set; }
135-
public string VersionNumber { get; set; }
136-
public bool? IsCommunityEdition { get; set; }
137-
public string VSVersion {get; set; }
138-
}
139-
140132
Func<bool> IsRunningOnOsx = () =>
141133
{
142134
return DirectoryExists("/Applications");
@@ -158,56 +150,4 @@ Func<string> GetXCBuildExtraParam = () => {
158150
}
159151

160152
return "";
161-
};
162-
163-
public MSBuildSettings GetDefaultMSBuildSettings()
164-
{
165-
if (IsRunningOnLinux()){
166-
return new MSBuildSettings { ToolPath = new FilePath("/usr/bin/msbuild")};
167-
}
168-
return new MSBuildSettings();
169-
}
170-
171-
public void CrossPlatformBuild(string filePath, Settings settings)
172-
{
173-
if (settings == null)
174-
{
175-
MSBuild(filePath, GetDefaultMSBuildSettings());
176-
}
177-
else
178-
{
179-
var msbuildSettings = GetDefaultMSBuildSettings();
180-
181-
if(!string.IsNullOrEmpty(settings.Target))
182-
{
183-
msbuildSettings.WithTarget(settings.Target);
184-
}
185-
186-
if(!string.IsNullOrEmpty(settings.Configuration))
187-
{
188-
msbuildSettings.SetConfiguration(settings.Configuration);
189-
}
190-
191-
if (settings.IsCommunityEdition.HasValue)
192-
{
193-
string assemblyProduct = settings.IsCommunityEdition.Value ? "\"XComponent Community Edition\"" : "\"XComponent Workgroup Edition\"";
194-
msbuildSettings.WithProperty("AssemblyProduct", assemblyProduct);
195-
if (settings.IsCommunityEdition.Value)
196-
{
197-
msbuildSettings.WithProperty("DefineConstants", "CommunityEdition");
198-
}
199-
}
200-
201-
if (!string.IsNullOrEmpty(settings.VersionNumber))
202-
{
203-
msbuildSettings.WithProperty("VersionNumber", settings.VersionNumber);
204-
}
205-
206-
if (!string.IsNullOrEmpty(settings.VSVersion))
207-
{
208-
msbuildSettings.WithProperty("VSVersion", settings.VSVersion);
209-
}
210-
211-
MSBuild(filePath, msbuildSettings);
212-
}
213-
}
153+
};
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 14
3-
VisualStudioVersion = 14.0.25420.1
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.28307.421
44
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateInstances", "CreateInstances\CreateInstances.csproj", "{1913E80B-BC0D-4AC6-8D05-C675D55627E7}"
5+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreateInstances", "CreateInstances\CreateInstances.csproj", "{1913E80B-BC0D-4AC6-8D05-C675D55627E7}"
66
EndProject
77
Global
88
GlobalSection(SolutionConfigurationPlatforms) = preSolution
99
Debug|x86 = Debug|x86
1010
Release|x86 = Release|x86
1111
EndGlobalSection
1212
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13-
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Debug|x86.ActiveCfg = Debug|x86
14-
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Debug|x86.Build.0 = Debug|x86
15-
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Release|x86.ActiveCfg = Release|x86
16-
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Release|x86.Build.0 = Release|x86
13+
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Debug|x86.ActiveCfg = Debug|Any CPU
14+
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Debug|x86.Build.0 = Debug|Any CPU
15+
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Release|x86.ActiveCfg = Release|Any CPU
16+
{1913E80B-BC0D-4AC6-8D05-C675D55627E7}.Release|x86.Build.0 = Release|Any CPU
1717
EndGlobalSection
1818
GlobalSection(SolutionProperties) = preSolution
1919
HideSolutionNode = FALSE
2020
EndGlobalSection
21+
GlobalSection(ExtensibilityGlobals) = postSolution
22+
SolutionGuid = {D81C8A5C-D0CA-46BF-A306-ACDB011E75A6}
23+
EndGlobalSection
2124
EndGlobal

docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/App.config

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 13 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,28 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{1913E80B-BC0D-4AC6-8D05-C675D55627E7}</ProjectGuid>
94
<OutputType>Exe</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>CreateInstances</RootNamespace>
12-
<AssemblyName>CreateInstances</AssemblyName>
13-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14-
<FileAlignment>512</FileAlignment>
15-
<TargetFrameworkProfile />
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
18-
<PlatformTarget>x86</PlatformTarget>
19-
<DebugSymbols>true</DebugSymbols>
20-
<DebugType>full</DebugType>
21-
<Optimize>false</Optimize>
22-
<OutputPath>bin\Debug\</OutputPath>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
28-
<PlatformTarget>x86</PlatformTarget>
29-
<DebugType>pdbonly</DebugType>
30-
<Optimize>true</Optimize>
31-
<OutputPath>bin\Release\</OutputPath>
32-
<DefineConstants>TRACE</DefineConstants>
33-
<ErrorReport>prompt</ErrorReport>
34-
<WarningLevel>4</WarningLevel>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
6+
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
357
</PropertyGroup>
8+
369
<ItemGroup>
37-
<Reference Include="ReactiveXComponent, Version=6.0.0.30008, Culture=neutral, processorArchitecture=MSIL">
38-
<SpecificVersion>False</SpecificVersion>
10+
<PackageReference Include="System.Reactive.Linq" Version="3.1.1" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<Reference Include="ReactiveXComponent">
3915
<HintPath>..\..\rxcAssemblies\ReactiveXComponent.dll</HintPath>
4016
</Reference>
41-
<Reference Include="System" />
42-
<Reference Include="System.Core" />
43-
<Reference Include="System.Reactive.Core, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
44-
<HintPath>..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll</HintPath>
45-
</Reference>
46-
<Reference Include="System.Reactive.Interfaces, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
47-
<HintPath>..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll</HintPath>
48-
</Reference>
49-
<Reference Include="System.Reactive.Linq, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
50-
<HintPath>..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll</HintPath>
51-
</Reference>
52-
<Reference Include="System.Windows" />
53-
<Reference Include="System.Windows.Forms" />
54-
<Reference Include="WindowsBase" />
5517
<Reference Include="XComponent.HelloWorld.UserObject">
5618
<HintPath>xcassemblies\XComponent.HelloWorld.UserObject.dll</HintPath>
5719
</Reference>
5820
</ItemGroup>
21+
5922
<ItemGroup>
60-
<Compile Include="Program.cs" />
61-
<Compile Include="Properties/AssemblyInfo.cs" />
62-
</ItemGroup>
63-
<ItemGroup>
64-
<None Include="App.config" />
65-
<None Include="packages.config" />
66-
<None Include="xcassemblies\HelloWorldV5Api.xcApi">
23+
<None Update="xcassemblies\HelloWorldV5Api.xcApi">
6724
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
6825
</None>
6926
</ItemGroup>
70-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
71-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
72-
Other similar extension points exist, see Microsoft.Common.targets.
73-
<Target Name="BeforeBuild">
74-
</Target>
75-
<Target Name="AfterBuild">
76-
</Target>
77-
-->
27+
7828
</Project>

docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.CodeDom;
32
using System.Collections.Concurrent;
43
using System.Collections.Generic;
54
using System.Linq;

docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

docker/integration_tests/XCProjects/HelloWorldV5/CreateInstancesReactiveApi/CreateInstances/packages.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

docker/integration_tests/dockerScripts/AppsContainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mono:5.12
1+
FROM microsoft/dotnet:sdk
22
USER root
33

44
RUN apt-get update && apt-get install -y unzip iputils-ping telnet net-tools dos2unix && rm -rf /var/lib/apt/lists/* /tmp/*

docker/integration_tests/dockerScripts/AppsContainer/RunApp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ chmod +x wait_for_it.sh
88

99
echo "App launched"
1010
sleep 35
11-
cd ./Debug/ && bash ./../wait_for_it.sh rabbitmq:5672 -- mono $APP
11+
cd ./Debug/ && bash ./../wait_for_it.sh rabbitmq:5672 -- dotnet $APP

0 commit comments

Comments
 (0)