diff --git a/Jenkinsfile b/Jenkinsfile index 58cf72a..e163086 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=293']) { + withEnv(['NEXT_BUILD_NUMBER=294']) { // env.versionNumber = VersionNumber(versionNumberString : '2.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'SCMA' @@ -105,12 +105,8 @@ pipeline { else { env.currConfig='Release' } + // Build adapters MTC7OPC-UA-RED bat "\"${tool 'MSBuild-15.0'}\" MTC_Adapter/SCMA/SCMA.csproj -target:Build /p:FS30D=1 /p:SIEMENS=1 /p:Configuration=${env.currConfig} /p:DebugSymbols=false /p:DebugType=None /p:OutputPath=bin/${env.versionNumber} /m" - - // // Build adapters VERI - // // bat "\"${tool 'MSBuild-15.0'}\" MTC_Adapter/SCMA/SCMA.csproj -target:Build /p:FS30D=1 /p:SIEMENS=1 /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.versionNumber} /m" - // // bat "\"${tool 'MSBuild-15.0'}\" MTC_Adapter/SCMA/SCMA.csproj -target:Build /p:DefineConstants=\"FS30D=1,SIEMENS=1\" /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.versionNumber} /m" - // // bat "\"${tool 'MSBuild-15.0'}\" MTC_Adapter/SCMA/SCMA.csproj -target:Build /p:FS30D=1 /p:SIEMENS=1 /p:Configuration=${env.BRANCH_NAME} /p:VisualStudioVersion=15.0 /p:RunCodeAnalysis=false /p:Platform=\"Any CPU\" /p:DebugSymbols=false /p:DebugType=None /p:OutputPath=bin/${env.versionNumber} /m" } } } diff --git a/MTC_Adapter/SCMA/App.config b/MTC_Adapter/SCMA/App.config index 04b2ccf..aec85fe 100644 --- a/MTC_Adapter/SCMA/App.config +++ b/MTC_Adapter/SCMA/App.config @@ -1,4 +1,4 @@ - + @@ -53,7 +53,7 @@ - + @@ -117,12 +117,16 @@ - + - + @@ -133,7 +137,8 @@ - + diff --git a/MTC_Adapter/SCMA/SCMA.csproj b/MTC_Adapter/SCMA/SCMA.csproj index 9f851c8..30319c2 100644 --- a/MTC_Adapter/SCMA/SCMA.csproj +++ b/MTC_Adapter/SCMA/SCMA.csproj @@ -158,6 +158,7 @@ SetupAdapter.cs + MainForm.cs @@ -196,6 +197,9 @@ + + + diff --git a/MTC_Adapter/SCMA/packages.config b/MTC_Adapter/SCMA/packages.config index 86777d2..87aa9c7 100644 --- a/MTC_Adapter/SCMA/packages.config +++ b/MTC_Adapter/SCMA/packages.config @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/NuGet.Config b/MTC_Adapter/packages/PrettyBin.1.0.4/NuGet.Config new file mode 100644 index 0000000..694ba68 --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/NuGet.targets b/MTC_Adapter/packages/PrettyBin.1.0.4/NuGet.targets new file mode 100644 index 0000000..6440ee8 --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/NuGet.targets @@ -0,0 +1,139 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + "$(SolutionDir) " + "$(SolutionDir)" + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) + $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/PrettyBin.1.0.4.nupkg b/MTC_Adapter/packages/PrettyBin.1.0.4/PrettyBin.1.0.4.nupkg new file mode 100644 index 0000000..1e47807 Binary files /dev/null and b/MTC_Adapter/packages/PrettyBin.1.0.4/PrettyBin.1.0.4.nupkg differ diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/README.md b/MTC_Adapter/packages/PrettyBin.1.0.4/README.md new file mode 100644 index 0000000..d043d75 --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/README.md @@ -0,0 +1,4 @@ +PrettyBin +========= + +Nuget package for C#, that moves dll,pdb and xml in bin/lib subfolder and ensures, that everything works. diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/content/App.config.install.xdt b/MTC_Adapter/packages/PrettyBin.1.0.4/content/App.config.install.xdt new file mode 100644 index 0000000..840f6db --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/content/App.config.install.xdt @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/makePackage.bat b/MTC_Adapter/packages/PrettyBin.1.0.4/makePackage.bat new file mode 100644 index 0000000..703225d --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/makePackage.bat @@ -0,0 +1,2 @@ +del PrettyBin.*.*.*.nupkg +nuget.exe pack PrettyBin.nuspec \ No newline at end of file diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/tools/init.ps1 b/MTC_Adapter/packages/PrettyBin.1.0.4/tools/init.ps1 new file mode 100644 index 0000000..38d8c11 --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/tools/init.ps1 @@ -0,0 +1,3 @@ +param($installPath, $toolsPath, $package, $project) + +Write-Host 'Init BinPrettify' \ No newline at end of file diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/tools/install.ps1 b/MTC_Adapter/packages/PrettyBin.1.0.4/tools/install.ps1 new file mode 100644 index 0000000..d3f2a85 --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/tools/install.ps1 @@ -0,0 +1,78 @@ +param($installPath, $toolsPath, $package, $project) + + +Try +{ + $path = $project.FullName + Write-Host 'Install PrettifyBin; ' + [xml]$doc = [xml](Get-Content $path) + + + # If a Namespace URI was not given, use the Xml document's default namespace. + $NamespaceURI = $doc.DocumentElement.NamespaceURI + Write-Host $NamespaceURI + # In order for SelectSingleNode() to actually work, we need to use the fully qualified node path along with an Xml Namespace Manager, so set them up. + $xmlNsManager = New-Object System.Xml.XmlNamespaceManager($doc.NameTable) + $xmlNsManager.AddNamespace("ns", $NamespaceURI) + + + # ============ This script attemps to Create this tags in csproj: ======== + # + # + # + # + # + # + # + + + + + $targetNode = $doc.SelectSingleNode("//ns:Project/ns:Target[@Name='AfterBuild']", $xmlNsManager) + + if ($targetNode -eq $null) + { + Write-Host 'No Target AfterBuild Node. Creating' + $targetNode = $doc.CreateElement('Target', $NamespaceURI ) + $targetNode.SetAttribute("Name" ,"AfterBuild") + $doc.Project.AppendChild($targetNode) + } + + + $filesToMoveNode = $targetNode.SelectSingleNode("//ns:ItemGroup/ns:MoveToLibFolder", $xmlNsManager) + + if ($filesToMoveNode -eq $null) + { + Write-Host 'No ItemGroup whith MoveToLibFolder tag. Creating' + $itemGroup = $doc.CreateElement('ItemGroup', $NamespaceURI) + $filesToMoveNode = $doc.CreateElement('MoveToLibFolder', $NamespaceURI) + + $itemGroup.AppendChild($filesToMoveNode) + $targetNode.AppendChild($itemGroup) + } + + $filesToMoveNode.SetAttribute("Include" ,'$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml') + + + $MoveNode = $targetNode.SelectSingleNode('//ns:Move[contains(@SourceFiles,"@(MoveToLibFolder)")]', $xmlNsManager) + if ($MoveNode -eq $null) + { + Write-Host 'No Move tag in AfterBuild Target. Creating' + $MoveNode = $doc.CreateElement('Move', $NamespaceURI) + $MoveNode.SetAttribute("SourceFiles" ,'@(MoveToLibFolder)') + $targetNode.AppendChild($MoveNode) + } + $MoveNode.SetAttribute("DestinationFolder",'$(OutputPath)lib') + $MoveNode.SetAttribute("OverwriteReadOnlyFiles","true") + + $doc.Save($path) +} +Catch +{ + $ErrorMessage = $_.Exception.Message + $FailedItem = $_.Exception.ItemName + Write-Host $ErrorMessage + Write-Host $FailedItem + Break +} + diff --git a/MTC_Adapter/packages/PrettyBin.1.0.4/tools/uninstall.ps1 b/MTC_Adapter/packages/PrettyBin.1.0.4/tools/uninstall.ps1 new file mode 100644 index 0000000..a2b6844 --- /dev/null +++ b/MTC_Adapter/packages/PrettyBin.1.0.4/tools/uninstall.ps1 @@ -0,0 +1,45 @@ +param($installPath, $toolsPath, $package, $project) + + +Try +{ + $path = $project.FullName + Write-Host 'Uninstall PrettifyBin; ' + [ xml ]$doc = [ xml ](Get-Content $path) + + + # If a Namespace URI was not given, use the Xml document's default namespace. + $NamespaceURI = $doc.DocumentElement.NamespaceURI + Write-Host $NamespaceURI + # In order for SelectSingleNode() to actually work, we need to use the fully qualified node path along with an Xml Namespace Manager, so set them up. + $xmlNsManager = New-Object System.Xml.XmlNamespaceManager($doc.NameTable) + $xmlNsManager.AddNamespace("ns", $NamespaceURI) + + + # ============ This script attemps to remove this tags in csproj: ======== + # + # + # + # + + + $moveNode = $doc.SelectSingleNode("//ns:Project/ns:Target[@Name='AfterBuild']/ns:Move[contains(@SourceFiles,'@(MoveToLibFolder)')]", $xmlNsManager) + + if ($moveNode -ne $null) + { + Write-Host 'We will delete move node' + $moveNode.ParentNode.RemoveChild($moveNode) + } + + + $doc.Save($path) +} +Catch +{ + $ErrorMessage = $_.Exception.Message + $FailedItem = $_.Exception.ItemName + Write-Host $ErrorMessage + Write-Host $FailedItem + Break +} +