Skip to content

Commit e998e7d

Browse files
committed
Updates to the packager to supply messaging when setting the assembly version information.
1 parent 5c3eb99 commit e998e7d

File tree

15 files changed

+58
-35
lines changed

15 files changed

+58
-35
lines changed

src/CodeFactoryVisualStudio/CodeFactory.DotNet/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.22315.0.3")]
36+
[assembly: AssemblyFileVersion("1.22318.0.3")]

src/CodeFactoryVisualStudio/CodeFactory.Formatting.CSharp/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.22315.0.3")]
36+
[assembly: AssemblyFileVersion("1.22318.0.3")]

src/CodeFactoryVisualStudio/CodeFactory.Logging/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.22315.0.3")]
36+
[assembly: AssemblyFileVersion("1.22318.0.3")]

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Loader/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.22315.0.3")]
36+
[assembly: AssemblyFileVersion("1.22318.0.3")]

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Loader/SdkSupport.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@ public static class SdkSupport
1616
/// <summary>
1717
/// The minimum version of the SDK that can be loaded and used.
1818
/// </summary>
19-
public const string MinVersion = "1.22315.0.1";
19+
public const string MinVersion = "1.22318.0.1";
2020

2121
/// <summary>
2222
/// The maximum version of the SDK that can be loaded and used.
2323
/// </summary>
24-
public const string MaxVersion = "1.22315.0.3";
24+
public const string MaxVersion = "1.22318.0.3";
25+
26+
/// <summary>
27+
/// The target version of the NuGet package this SDK is deployed from.
28+
/// </summary>
29+
public const string NuGetSdkVersion = "1.22318.3";
2530

2631
/// <summary>
2732
/// Checks the assembly to see if it was created by a CodeFactory SDK. If so it checks the version to confirms it can be used by the runtime.
@@ -45,7 +50,7 @@ public static void SupportedAssembly(Assembly sourceAssembly)
4550
int libraryVersion = Convert.ToInt32(rawVersion.Replace(".", ""));
4651

4752
int minVersion = Convert.ToInt32(MinVersion.Replace(".", ""));
48-
int maxVersion = Convert.ToInt32(MinVersion.Replace(".", ""));
53+
int maxVersion = Convert.ToInt32(MaxVersion.Replace(".", ""));
4954

5055
if (libraryVersion < minVersion || libraryVersion > maxVersion)
5156
throw new UnsupportedSdkLibraryException(sourceAssembly.FullName, rawVersion, MinVersion,

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Packager/CodeFactory.VisualStudio.Packager.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
<Compile Include="PackagerData.cs" />
6161
<Compile Include="Program.cs" />
6262
<Compile Include="Properties\AssemblyInfo.cs" />
63-
<Compile Include="UnsupportedSDKLibrary.cs" />
6463
</ItemGroup>
6564
<ItemGroup>
6665
<None Include="App.config" />

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Packager/CodeFactorySDK.nuspec

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd" >
33
<metadata>
44
<id>CodeFactorySDK</id>
5-
<version>1.22315.3</version>
5+
<version>1.22318.3</version>
66
<title>CodeFactory Software Development Kit</title>
77
<authors>CodeFactory, LLC.</authors>
88
<owners>CodeFactory, LLC.</owners>
@@ -11,7 +11,7 @@
1111
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1212
<description>Software factory automation library used with the CodeFactory for Visual Studio.</description>
1313
<releaseNotes>
14-
SDK Update for CodeFactory 1.22315.3
14+
SDK Update for CodeFactory 1.22318.3
1515

1616
This release of the SDK focuses on the following.
1717
- Have updated the injection process of code into files. You no longer have to provide the file path, framework determines this.
@@ -45,6 +45,8 @@
4545
If documentation was provided in each partial file it will grab the target file the model generation was requested from.
4646
- All C# Models now have a ModelSourceFile property that identifies the source code file the model was generated from.
4747
- Fixed an issue with the Visual Studio packager not able to process project paths that had spaces in the path.
48+
- Packager now injects the target platform and SDK version information directly into assemblies during the build of CodeFactory automation.
49+
This is used to confirm the library is supported by the runtime.
4850
</releaseNotes>
4951
<copyright>Copyright 2022</copyright>
5052
<tags>Factory Automation</tags>

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Packager/Program.cs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ private static int ProcessProject(string projectPath)
233233

234234
int result = WriteNewAssemblyInfo(assemblyInfoPath);
235235

236+
Console.WriteLine($"--> Updating Project: {Path.GetDirectoryName(projectPath)}");
237+
Console.WriteLine($"--> Setting SDK Version to : {LoadFileVersion()}");
238+
Console.WriteLine();
239+
236240
return result;
237241
}
238242

@@ -274,27 +278,50 @@ private static int UpdateAssemblyInfo(string assemblyPath)
274278
{
275279
envFound = Regex.IsMatch(assemblyData, AttributeManager.RegexFindCFEnvironment);
276280

277-
if (envFound) updatedContent = Regex.Replace(assemblyData, AttributeManager.RegexFindCFEnvironment,envAttribute);
281+
if (envFound)
282+
{
283+
updatedContent = Regex.Replace(assemblyData, AttributeManager.RegexFindCFEnvironment,envAttribute);
284+
Console.WriteLine($"--> Updating CodeFactory environment attribute to '{envAttribute}'");
285+
286+
}
278287
}
279288

280289
if (!versionFound)
281290
{
282291
versionFound = Regex.IsMatch(assemblyData, AttributeManager.RegexFindCFSdkVersion);
283292

284-
if (versionFound) updatedContent = Regex.Replace(assemblyData, AttributeManager.RegexFindCFSdkVersion,versionAttribute);
293+
if (versionFound)
294+
{
295+
updatedContent = Regex.Replace(assemblyData, AttributeManager.RegexFindCFSdkVersion,versionAttribute);
296+
Console.WriteLine($"--> Updating CodeFactory SDK version to '{versionAttribute}'");
297+
298+
}
285299
}
286300

287301
assemblyDataUpdated.Add(updatedContent);
288302
}
289303

290-
291-
if(!envFound) assemblyDataUpdated.Add(envAttribute);
292-
if(!versionFound) assemblyDataUpdated.Add(versionAttribute);
304+
305+
if (!envFound)
306+
{
307+
assemblyDataUpdated.Add(envAttribute);
308+
Console.WriteLine($"--> Adding CodeFactory Environment attribute '{envAttribute}'");
309+
310+
}
311+
312+
if (!versionFound)
313+
{
314+
assemblyDataUpdated.Add(versionAttribute);
315+
Console.WriteLine($"--> Adding CodeFactory SDK version '{versionAttribute}'");
316+
317+
}
293318

294319
if (!hasUsingStatement)
295320
{
296321
formattedAssemblyData.Add(usingStatement);
297322
formattedAssemblyData.AddRange(assemblyDataUpdated);
323+
Console.WriteLine($"--> Adding using statement to the assemblyinfo file. '{usingStatement}'");
324+
298325
}
299326
else
300327
{
@@ -309,6 +336,8 @@ private static int UpdateAssemblyInfo(string assemblyPath)
309336
return PackagerData.ExitCodeCannotUpdateAssemblyInfo;
310337
}
311338

339+
Console.WriteLine("--> Updates Completed'");
340+
Console.WriteLine("");
312341

313342
return PackagerData.ExitCodeSuccess;
314343
}
@@ -325,7 +354,7 @@ private static int WriteNewAssemblyInfo(string assemblyPath)
325354
assemblyFileContents.Add("using System.Runtime.InteropServices;");
326355
assemblyFileContents.Add("");
327356
assemblyFileContents.Add("[assembly: AssemblyVersion(\"1.0.0.0\")]");
328-
assemblyFileContents.Add("[assembly: AssemblyFileVersion(\"1.22315.0.3\")]");
357+
assemblyFileContents.Add("[assembly: AssemblyFileVersion(\"1.22318.0.3\")]");
329358
assemblyFileContents.Add("[assembly: AssemblyCFEnvironment(\"CFVSW\")]");
330359
assemblyFileContents.Add($"[assembly: AssemblyCFSdkVersion(\"{LoadFileVersion()}\")]");
331360

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Packager/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
3636
[assembly: AssemblyVersion("1.0.0.0")]
37-
[assembly: AssemblyFileVersion("1.22315.0.3")]
37+
[assembly: AssemblyFileVersion("1.22318.0.3")]

src/CodeFactoryVisualStudio/CodeFactory.VisualStudio.Packager/UnsupportedSDKLibrary.cs

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

0 commit comments

Comments
 (0)