Skip to content

Commit

Permalink
fix: update dotnetTestBase assembly version (#1601)
Browse files Browse the repository at this point in the history
* fix: update dotnetTestBase assembly version so different pipelines do not interrupt each other

* fix version

* auto generate dotnetTestBase proj file because the in-place change updates version each time

* remove previous file
  • Loading branch information
serena-ruan authored Aug 5, 2022
1 parent c659b33 commit adf1a61
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 61 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
.vs
/core/src/main/dotnet/**/bin
/core/src/main/dotnet/**/obj
/core/src/main/dotnet/test/dotnetTestBase.csproj
/core/src/main/dotnet/test/SynapseMLVersion.cs
# temp ignore these two for local tests
/dotnetSanityCheck/**/bin
Expand Down
61 changes: 55 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import java.io.{File, PrintWriter}
import java.net.URL
import BuildUtils._
import org.apache.commons.io.FileUtils
import sbt.ExclusionRule
import xerial.sbt.Sonatype._

import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
import java.io.{File, PrintWriter}
import java.net.URL
import scala.xml.transform.{RewriteRule, RuleTransformer}
import BuildUtils._
import xerial.sbt.Sonatype._
import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}

val condaEnvName = "synapseml"
val sparkVersion = "3.2.2"
Expand Down Expand Up @@ -154,8 +154,57 @@ publishDotnetTestBase := {
val dotnetHelperFile = join(dotnetTestBaseDir, "SynapseMLVersion.cs")
if (dotnetHelperFile.exists()) FileUtils.forceDelete(dotnetHelperFile)
FileUtils.writeStringToFile(dotnetHelperFile, fileContent, "utf-8")

val dotnetTestBaseProjContent =
s"""<Project Sdk="Microsoft.NET.Sdk">
|
| <PropertyGroup>
| <TargetFramework>netstandard2.1</TargetFramework>
| <LangVersion>9.0</LangVersion>
| <AssemblyName>SynapseML.DotnetE2ETest</AssemblyName>
| <IsPackable>true</IsPackable>
| <Description>SynapseML .NET Test Base</Description>
| <Version>${dotnetedVersion(version.value)}</Version>
| </PropertyGroup>
|
| <ItemGroup>
| <PackageReference Include="xunit" Version="2.4.1" />
| <PackageReference Include="Microsoft.Spark" Version="2.1.1" />
| <PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.4.0" PrivateAssets="All" />
| </ItemGroup>
|
| <ItemGroup>
| <InternalsVisibleTo Include="SynapseML.Cognitive" />
| <InternalsVisibleTo Include="SynapseML.Core" />
| <InternalsVisibleTo Include="SynapseML.DeepLearning" />
| <InternalsVisibleTo Include="SynapseML.Lightgbm" />
| <InternalsVisibleTo Include="SynapseML.Opencv" />
| <InternalsVisibleTo Include="SynapseML.Vw" />
| <InternalsVisibleTo Include="SynapseML.Cognitive.Test" />
| <InternalsVisibleTo Include="SynapseML.Core.Test" />
| <InternalsVisibleTo Include="SynapseML.DeepLearning.Test" />
| <InternalsVisibleTo Include="SynapseML.Lightgbm.Test" />
| <InternalsVisibleTo Include="SynapseML.Opencv.Test" />
| <InternalsVisibleTo Include="SynapseML.Vw.Test" />
| </ItemGroup>
|
| <PropertyGroup>
| <InternalsAssemblyNames>Microsoft.Spark</InternalsAssemblyNames>
| </PropertyGroup>
|
| <PropertyGroup>
| <InternalsAssemblyUseEmptyMethodBodies>false</InternalsAssemblyUseEmptyMethodBodies>
| </PropertyGroup>
|
|</Project>""".stripMargin
// update the version of current dotnetTestBase assembly
val dotnetTestBaseProj = join(dotnetTestBaseDir, "dotnetTestBase.csproj")
if (dotnetTestBaseProj.exists()) FileUtils.forceDelete(dotnetTestBaseProj)
FileUtils.writeStringToFile(dotnetTestBaseProj, dotnetTestBaseProjContent, "utf-8")

packDotnetAssemblyCmd(join(dotnetTestBaseDir, "target").getAbsolutePath, dotnetTestBaseDir)
val packagePath = join(dotnetTestBaseDir, "target", s"SynapseML.DotnetE2ETest.0.9.1.nupkg").getAbsolutePath
val packagePath = join(dotnetTestBaseDir,
"target", s"SynapseML.DotnetE2ETest.${dotnetedVersion(version.value)}.nupkg").getAbsolutePath
publishDotnetAssemblyCmd(packagePath, rootGenDir.value)
}

Expand Down
41 changes: 0 additions & 41 deletions core/src/main/dotnet/test/dotnetTestBase.csproj

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ object DotnetTestGen {
| </PackageReference>
| <PackageReference Include="Microsoft.Spark" Version="2.1.1" />
| <PackageReference Include="SynapseML.DotnetBase" Version="0.9.1" />
| <PackageReference Include="SynapseML.DotnetE2ETest" Version="0.9.1" />
| <PackageReference Include="SynapseML.DotnetE2ETest" Version="${conf.dotnetVersion}" />
| <PackageReference Include="SynapseML.$curProject" Version="${conf.dotnetVersion}" />
| $referenceCore
| <PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.4.0" PrivateAssets="All" />
Expand Down
16 changes: 3 additions & 13 deletions project/CodegenPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ object CodegenPlugin extends AutoPlugin {
val rVersion = settingKey[String]("R version")
val genRPackageNamespace = settingKey[String]("genRPackageNamespace")

val dotnetVersion = settingKey[String]("Dotnet version")

val genPackageNamespace = settingKey[String]("genPackageNamespace")
val genTestPackageNamespace = settingKey[String]("genTestPackageNamespace")

Expand Down Expand Up @@ -166,7 +164,7 @@ object CodegenPlugin extends AutoPlugin {
version.value,
pythonizedVersion(version.value),
rVersion.value,
dotnetVersion.value,
dotnetedVersion(version.value),
genPackageNamespace.value
).toJson.compactPrint
},
Expand All @@ -179,7 +177,7 @@ object CodegenPlugin extends AutoPlugin {
version.value,
pythonizedVersion(version.value),
rVersion.value,
dotnetVersion.value,
dotnetedVersion(version.value),
genPackageNamespace.value
).toJson.compactPrint
},
Expand Down Expand Up @@ -214,14 +212,6 @@ object CodegenPlugin extends AutoPlugin {
version.value
}
},
dotnetVersion := {
if (version.value.contains("-")) {
val versionArray = version.value.split("-".toCharArray)
versionArray.head + "-rc" + versionArray.drop(1).dropRight(1).mkString("")
} else {
version.value
}
},
packageR := {
createCondaEnvTask.value
codegen.value
Expand Down Expand Up @@ -310,7 +300,7 @@ object CodegenPlugin extends AutoPlugin {
packageDotnet.value
val dotnetPackageName = name.value.split("-").drop(1).map(s => s.capitalize).mkString("")
val packagePath = join(codegenDir.value, "package", "dotnet",
s"SynapseML.$dotnetPackageName.${dotnetVersion.value}.nupkg").absolutePath
s"SynapseML.$dotnetPackageName.${dotnetedVersion(version.value)}.nupkg").absolutePath
publishDotnetAssemblyCmd(packagePath, mergeCodeDir.value)
},
targetDir := {
Expand Down

0 comments on commit adf1a61

Please sign in to comment.