Skip to content

Commit

Permalink
update build/version logic
Browse files Browse the repository at this point in the history
tiny setting in widget projects
  • Loading branch information
ninianne98 committed Apr 25, 2024
1 parent 24b6e65 commit 8bc8936
Show file tree
Hide file tree
Showing 17 changed files with 670 additions and 633 deletions.
11 changes: 7 additions & 4 deletions CMSAdmin/CMSAdminCore.csproj
Expand Up @@ -13,13 +13,16 @@
<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2023</Copyright>
<ProductName>Carrot Cake CMS</ProductName>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product Condition="'$(Configuration)' == 'Release'">Carrot Cake CMS, built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm"))</Product>
<Product Condition="'$(Configuration)' == 'Debug'">Carrot Cake CMS, debug built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm")) DEBUG</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<Build>$([System.DateTime]::op_Subtraction($([System.DateTime]::get_Now().get_Date()),$([System.DateTime]::new(2000,1,1))).get_TotalDays())</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalSeconds()), 2).ToString('F0'))</Revision>
<VersionSuffix>$(Build).$(Revision)</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion CMSAdmin/Views/CmsAdmin/About.cshtml
Expand Up @@ -18,7 +18,7 @@
</style>

<p>
The currently running version of this CMS is <span>@SiteData.CarrotCakeCMSVersion</span>.
The currently running version of this CMS is <span>@SiteData.CarrotCakeCMSVersionShort</span>.
</p>
<p>
<a href="http://www.carrotware.com/" target="_blank">CarrotCake CMS by CarrotWare</a> is dual licensed under the MIT or GPL Version 3 licenses.
Expand Down
1 change: 1 addition & 0 deletions CMSAdmin/wwwroot/Assets/Admin/Includes/tinymce-config.js
Expand Up @@ -32,6 +32,7 @@ function cmsTinyMceInit(winWidth, winHeight, allowResize) {
file_picker_types: 'file image media',
file_picker_callback: cmsTinyFileBrowserCallback,
promotion: false,
convert_unsafe_embeds: true,
plugins: 'image link lists media charmap searchreplace visualblocks table preview code codesample help',
toolbar1: 'bold italic underline strikethrough sub sup | blocks forecolor backcolor | blockquote alignleft aligncenter alignright alignjustify outdent indent | help | ',
toolbar2: 'undo redo searchreplace | bullist numlist | removeformat pastetext | link unlink anchor image media customfilebrowser | charmap codesample code preview visualblocks',
Expand Down
10 changes: 6 additions & 4 deletions CMSComponents/CMSComponents.csproj
Expand Up @@ -13,13 +13,15 @@
<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2023</Copyright>
<ProductName>Carrot Cake CMS</ProductName>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product>Carrot Cake CMS, built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm"))</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<Build>$([System.DateTime]::op_Subtraction($([System.DateTime]::get_Now().get_Date()),$([System.DateTime]::new(2000,1,1))).get_TotalDays())</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalSeconds()), 2).ToString('F0'))</Revision>
<VersionSuffix>$(Build).$(Revision)</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

Expand Down
11 changes: 7 additions & 4 deletions CMSCore/CMSCore.csproj
Expand Up @@ -13,13 +13,16 @@
<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2023</Copyright>
<ProductName>Carrot Cake CMS</ProductName>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product Condition="'$(Configuration)' == 'Release'">Carrot Cake CMS, built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm"))</Product>
<Product Condition="'$(Configuration)' == 'Debug'">Carrot Cake CMS, debug built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm")) DEBUG</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<Build>$([System.DateTime]::op_Subtraction($([System.DateTime]::get_Now().get_Date()),$([System.DateTime]::new(2000,1,1))).get_TotalDays())</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalSeconds()), 2).ToString('F0'))</Revision>
<VersionSuffix>$(Build).$(Revision)</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

Expand Down
15 changes: 12 additions & 3 deletions CMSCore/SiteContent/SiteDataStatic.cs
Expand Up @@ -7,7 +7,6 @@
using System.Security;
using System.Text;
using System.Web;
using System.Xml;

/*
* CarrotCake CMS (MVC Core)
Expand Down Expand Up @@ -808,9 +807,10 @@ public partial class SiteData {

private static void LoadFileInfo() {
if (_fileversion == null) {
_debug = false;
#if DEBUG
_debug = true;
#else
_debug = false;
#endif
var assembly = Assembly.GetExecutingAssembly();
_fileversion = FileVersionInfo.GetVersionInfo(assembly.Location);
Expand All @@ -820,7 +820,16 @@ public partial class SiteData {
public static string CurrentDLLVersion {
get {
LoadFileInfo();
return _fileversion.FileVersion;
return _fileversion != null ? _fileversion.FileVersion : "1.1.0.0";
}
}

public static string CarrotCakeCMSVersionShort {
get {
LoadFileInfo();
var releaseMask = _debug.Value ? "MVC Core {0} (debug)" : "MVC Core {0}";

return string.Format(releaseMask, CurrentDLLVersion);
}
}

Expand Down
12 changes: 8 additions & 4 deletions CMSInterfaces/CMSInterfaces.csproj
Expand Up @@ -13,16 +13,20 @@
<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2023</Copyright>
<ProductName>Carrot Cake CMS</ProductName>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product Condition="'$(Configuration)' == 'Release'">Carrot Cake CMS, built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm"))</Product>
<Product Condition="'$(Configuration)' == 'Debug'">Carrot Cake CMS, debug built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm")) DEBUG</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<Build>$([System.DateTime]::op_Subtraction($([System.DateTime]::get_Now().get_Date()),$([System.DateTime]::new(2000,1,1))).get_TotalDays())</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalSeconds()), 2).ToString('F0'))</Revision>
<VersionSuffix>$(Build).$(Revision)</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.4" />
</ItemGroup>
Expand Down
10 changes: 6 additions & 4 deletions CMSSecurity/CMSSecurity.csproj
Expand Up @@ -13,13 +13,15 @@
<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2023</Copyright>
<ProductName>Carrot Cake CMS</ProductName>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product>Carrot Cake CMS, built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm"))</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<Build>$([System.DateTime]::op_Subtraction($([System.DateTime]::get_Now().get_Date()),$([System.DateTime]::new(2000,1,1))).get_TotalDays())</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalSeconds()), 2).ToString('F0'))</Revision>
<VersionSuffix>$(Build).$(Revision)</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

Expand Down
10 changes: 6 additions & 4 deletions CarrotCMSData/CMSData.csproj
Expand Up @@ -13,13 +13,15 @@
<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2023</Copyright>
<ProductName>Carrot Cake CMS</ProductName>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product>Carrot Cake CMS, built @ $([System.DateTime]::UtcNow.ToString("yyMMdd")) $([System.DateTime]::UtcNow.ToString("HH:mm"))</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<Build>$([System.DateTime]::op_Subtraction($([System.DateTime]::get_Now().get_Date()),$([System.DateTime]::new(2000,1,1))).get_TotalDays())</Build>
<Revision>$([MSBuild]::Divide($([System.DateTime]::get_Now().get_TimeOfDay().get_TotalSeconds()), 2).ToString('F0'))</Revision>
<VersionSuffix>$(Build).$(Revision)</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

Expand Down
165 changes: 83 additions & 82 deletions LoremIpsum/LoremIpsum.csproj
@@ -1,84 +1,85 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<OutputPath>bin\</OutputPath>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultItems>false</EnableDefaultItems>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<RootNamespace>CarrotCake.CMS.Plugins.LoremIpsum</RootNamespace>
<AssemblyName>LoremIpsum</AssemblyName>
</PropertyGroup>

<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>2015</Copyright>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>8.1.0.0</Version>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.18" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Code\lorem.txt" />
<Content Include="appsettings.Development.json" />
<Content Include="appsettings.json" />
<Content Include="Content\Site.css" />
</ItemGroup>
<ItemGroup>
<Compile Include="Code\LoremRegistration.cs" />
<Compile Include="Code\WebHelper.cs" />
<Compile Include="Controllers\AdminController.cs" />
<Compile Include="Models\ContentCreator.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<OutputPath>bin\</OutputPath>
<ImplicitUsings>enable</ImplicitUsings>
<EnableDefaultItems>false</EnableDefaultItems>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<RootNamespace>CarrotCake.CMS.Plugins.LoremIpsum</RootNamespace>
<AssemblyName>LoremIpsum</AssemblyName>
</PropertyGroup>

<PropertyGroup>
<Authors>Carrotware</Authors>
<Company>Carrotware</Company>
<Copyright>$([System.DateTime]::Now.Year)</Copyright>
<Product>Carrot Cake CMS Widget</Product>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<VersionPrefix>8.1</VersionPrefix>
<VersionSuffix>$([System.DateTime]::UtcNow.ToString("yyMMdd")).$([System.DateTime]::UtcNow.ToString("HHmmss"))</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<Version>$(VersionPrefix).0.0</Version>
<FileVersion>$(VersionPrefix).$(VersionSuffix)</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.18" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.18" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Code\lorem.txt" />
<Content Include="appsettings.Development.json" />
<Content Include="appsettings.json" />
<Content Include="Content\Site.css" />
</ItemGroup>
<ItemGroup>
<Compile Include="Code\LoremRegistration.cs" />
<Compile Include="Code\WebHelper.cs" />
<Compile Include="Controllers\AdminController.cs" />
<Compile Include="Models\ContentCreator.cs" />
<Compile Include="Program.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="global.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Properties\C3ConfigSchema.json" />
<Content Include="Properties\launchSettings.json" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="wwwroot\favicon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CMSCore\CMSCore.csproj" />
<ProjectReference Include="..\CMSInterfaces\CMSInterfaces.csproj" />
<ProjectReference Include="..\WebComponents\WebComponents.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Shared\_LayoutPop.cshtml" />
</ItemGroup>

<ItemGroup>
<Content Include="Views\_ViewImports.cshtml" />
</ItemGroup>

<ItemGroup>
<None Include="Views\Admin.config" />
<None Include="Views\Admin\Index.cshtml" />
<None Include="Views\Admin\View.cshtml" />
<None Include="Views\Admin\Login.cshtml" />
<None Include="Views\Shared\_LayoutModule.cshtml" />
</ItemGroup>

<ItemGroup>
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(ProjectDir)\bin\$(TargetName).*&quot; &quot;$(SolutionDir)\CMSAdmin\bin\&quot; /F/R/Y/I/S/C&#xD;&#xA;xcopy &quot;$(ProjectDir)\Views\*.config&quot; &quot;$(SolutionDir)\CMSAdmin\Views\$(TargetName)\&quot; /F /R /Y /I&#xD;&#xA;xcopy &quot;$(ProjectDir)\Views\_ViewImports.cshtml&quot; &quot;$(SolutionDir)\CMSAdmin\Views\$(TargetName)\&quot; /F /R /Y /I&#xD;&#xA;xcopy &quot;$(ProjectDir)\Views\Admin\*.cshtml&quot; &quot;$(SolutionDir)\CMSAdmin\Views\$(TargetName)\Admin\&quot; /F/R/Y/I/S/C&#xD;&#xA;&#xD;&#xA;REM (ProjectName) $(ProjectName)&#xD;&#xA;REM (ProjectDir) $(ProjectDir)&#xD;&#xA;REM (SolutionDir) $(SolutionDir)&#xD;&#xA;" />
</Target>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Properties\C3ConfigSchema.json" />
<Content Include="Properties\launchSettings.json" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="wwwroot\favicon.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CMSCore\CMSCore.csproj" />
<ProjectReference Include="..\CMSInterfaces\CMSInterfaces.csproj" />
<ProjectReference Include="..\WebComponents\WebComponents.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Shared\_LayoutPop.cshtml" />
</ItemGroup>

<ItemGroup>
<Content Include="Views\_ViewImports.cshtml" />
</ItemGroup>

<ItemGroup>
<None Include="Views\Admin.config" />
<None Include="Views\Admin\Index.cshtml" />
<None Include="Views\Admin\View.cshtml" />
<None Include="Views\Admin\Login.cshtml" />
<None Include="Views\Shared\_LayoutModule.cshtml" />
</ItemGroup>

<ItemGroup>
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy &quot;$(ProjectDir)\bin\$(TargetName).*&quot; &quot;$(SolutionDir)\CMSAdmin\bin\&quot; /F/R/Y/I/S/C&#xD;&#xA;xcopy &quot;$(ProjectDir)\Views\*.config&quot; &quot;$(SolutionDir)\CMSAdmin\Views\$(TargetName)\&quot; /F /R /Y /I&#xD;&#xA;xcopy &quot;$(ProjectDir)\Views\_ViewImports.cshtml&quot; &quot;$(SolutionDir)\CMSAdmin\Views\$(TargetName)\&quot; /F /R /Y /I&#xD;&#xA;xcopy &quot;$(ProjectDir)\Views\Admin\*.cshtml&quot; &quot;$(SolutionDir)\CMSAdmin\Views\$(TargetName)\Admin\&quot; /F/R/Y/I/S/C&#xD;&#xA;&#xD;&#xA;REM (ProjectName) $(ProjectName)&#xD;&#xA;REM (ProjectDir) $(ProjectDir)&#xD;&#xA;REM (SolutionDir) $(SolutionDir)&#xD;&#xA;" />
</Target>
</Project>

0 comments on commit 8bc8936

Please sign in to comment.