Skip to content

Commit

Permalink
Build: +different paths for MultiByte & Unicode modules;
Browse files Browse the repository at this point in the history
Also adds RXW_UNICODE for user targets when CharacterSet is Unicode
  • Loading branch information
3F committed Mar 7, 2021
1 parent 22ee544 commit 375a6d0
Show file tree
Hide file tree
Showing 17 changed files with 255 additions and 174 deletions.
103 changes: 64 additions & 39 deletions .vssbe
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[$(charset = $(CharacterSet))]",
"#[$(arch = $(Platform))]",
"",
"#[($(Configuration) == \"PublicRelease\") {",
" #[$(cfgname = 'Release')]",
" $(isPubRel = true)",
Expand All @@ -29,7 +32,7 @@
"$(revDeltaMax = 65534)",
"",
"$(oraw = \"bin\\raw\")",
"$(orawApp = \"$(oraw)\\$(cfgname)\\$(Platform)/\")",
"$(orawApp = \"$(oraw)\\$(cfgname)\\$(arch)\\$(charset)/\")",
"$(odir = \"bin/Releases/\")",
"$(onupkg = \"bin/nupkg/\")",
"",
Expand Down Expand Up @@ -74,11 +77,13 @@
" )]]",
" ",
" #[$(pVerBuild = \"$(pVer).$(revBuild)\")]",
" #[$(pVerBuild0 = $(pVerBuild))]",
"}",
"else",
"{",
" #[$(revBuild = 0)]",
" #[$(pVerBuild = \"$(pVer)\")]",
" #[$(pVerBuild0 = \"$(pVerBuild).0\")]",
"}]",
"",
"#[\" ",
Expand Down Expand Up @@ -141,11 +146,30 @@
"",
"",
"#[IO replace.Regex(\"$(pDir)/regXwild.common.cpp\", \"(vsSBE.+?_T\\().+?;\", \"$1\\\"#[$(pVerBuild)]\\\");\")]",
"",
""
]
}
},
{
"Enabled": true,
"Name": "ActRc",
"Caption": "Update .rc",
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"",
"#[var rc =#[File get(\"regXwild/regXwild.rc\")]]",
"",
"#[var rc =$([System.Text.RegularExpressions.Regex]::Replace('$(rc)', '(VERSION\\s)[\\d,]+', '${1}$(pVerBuild0.Replace(\".\", \",\"))'))]",
"#[var rc =$([System.Text.RegularExpressions.Regex]::Replace('$(rc)', '(Version\", \")[\\d.]+', '${1}$(pVerBuild0)'))]",
"",
"#[var rc =$([System.Text.RegularExpressions.Regex]::Replace('$(rc)', '(ProductVersion\", \")([^\"]+)\"', '${1}$(rxwPrintVersion)\"'))]",
"",
"#[File write(\"regXwild/regXwild.rc\"):#[var rc]]"
]
}
},
{
"Enabled": true,
"Name": "ActSubmodules",
Expand Down Expand Up @@ -206,6 +230,32 @@
]
}
},
{
"Enabled": true,
"Name": "BuildInfo",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[var buildInfo = $([System.String]::Concat(\" \"))",
" regXwild #[$(rxwPrintVersion)]",
" ",
" ",
" Configuration: #[$(Configuration)]",
" ",
" Build version: #[$(revBuild)]",
" ",
" SHA-1: #[$(bSha1)]",
" ",
" ",
" :: generated by a vsSolutionBuildEvent #[$(vsSolutionBuildEvent)]",
"]",
"",
"#[IO writeLine(\"$(orawApp)/build-info.txt\"):#[$(buildInfo.Replace('\\n', '\\r\\n'))]]"
]
}
},
{
"Enabled": true,
"Name": "ActPack",
Expand All @@ -230,18 +280,19 @@
"#[IO copy.file(\"$(pDir)\\core\\EXT\\AlgorithmExt.h\", \"$(orawApp)\\include\\core\\EXT\\\\\", true)]",
"#[IO copy.file(\"$(pDir)\\core\\ESS\\*.h\", \"$(orawApp)\\include\\core\\ESS\\\\\", true)]",
" ",
"#[IO copy.file({ \"Readme.md\", \"LICENSE\", \"changelog.txt\", \".version\" }, \"$(oraw)\", true)]",
"#[IO copy.file({ \"Readme.md\", \"LICENSE\", \"changelog.txt\", \".version\", \"$(orawApp)/build-info.txt\" }, \"$(oraw)\", true)]",
"#[IO copy.file({ \"tools\\*.bat\" }, \"$(oraw)\\tools\\\\\", true)]",
"",
"",
"#[( $(Platform) == \"Win32\") { #[$(fnamePlatform = 'x86')] }else{ #[$(fnamePlatform = $(Platform))] }]",
"#[( $(arch) == \"Win32\") { #[$(fnameArch = 'x86')] }else{ #[$(fnameArch = $(arch))] }]",
"",
"#[7z pack.files(",
" {",
" \"$(oraw)\\Readme.md\", ",
" \"$(oraw)\\LICENSE\",",
" \"$(oraw)\\changelog.txt\",",
" \"$(oraw)\\.version\",",
" \"$(oraw)\\build-info.txt\",",
" \"$(oraw)\\tools\\*.bat\",",
" \"$(orawApp)\\include\\*.h\",",
" \"$(orawApp)\\include\\core\\ESS\\*.h\",",
Expand All @@ -254,7 +305,7 @@
" \"$(orawApp)regXwild.exp\",",
" \"$(orawApp)regXwild.pdb\"",
" }, ",
" \"$(odir)regXwild.$(pVer).$(fnamePlatform).$(CharacterSet:regXwild).zip\")]",
" \"$(odir)regXwild.$(pVer).$(fnameArch).$(charset).zip\")]",
""
]
}
Expand All @@ -272,7 +323,7 @@
" #[try{ #[IO delete.directory(\"$(onupkg)\", true)] }catch{ }]",
"}]",
"",
"#[$(onupkgBin = \"$(onupkg)lib\\\\native\\\\$(Platform)-$(CharacterSet:regXwild)\\\\\")]",
"#[$(onupkgBin = \"$(onupkg)lib\\\\native\\\\$(arch)-$(charset)\\\\\")]",
"",
"#[\" https://github.com/3F/DllExport/issues/36 \"]",
"#[IO copy.directory(\"\", \"$(onupkg)/lib/net/\", true)]",
Expand Down Expand Up @@ -300,53 +351,27 @@
" \"$(onupkgBin)\", true)]",
" ",
"#[IO copy.file({ ",
" \"regXwild.nuspec\", ",
" \"tools\\regXwild.nuspec\", ",
" \"Readme.md\", ",
" \"$(oraw)\\.version\",",
" \"$(orawApp)/build-info.txt\",",
" \"LICENSE\", ",
" \"changelog.txt\" ",
" }, ",
" \"$(onupkg)\", true)]",
"#[IO replace(\"$(onupkg)regXwild.nuspec\", \"$-version-$\", \"$(pVer)\")]",
"",
"#[IO copy.directory(\"\", \"$(onupkg)build\\native\", true)]",
"#[IO copy.file(\"regXwild.native.targets\", \"$(onupkg)build\\native/regXwild.targets\", true)]",
"#[IO copy.file(\"tools\\regXwild.native.targets\", \"$(onupkg)build\\native/regXwild.targets\", true)]",
"",
"#[IO copy.directory(\"\", \"$(onupkg)build\\net\", true)]",
"#[IO copy.file(\"regXwild.dotnet.targets\", \"$(onupkg)build\\net/regXwild.targets\", true)]",
"#[IO copy.file(\"tools\\regXwild.dotnet.targets\", \"$(onupkg)build\\net/regXwild.targets\", true)]",
"",
"#[IO copy.directory(\"\", \"$(onupkg)build\\netcoreapp\", true)]",
"#[IO copy.file(\"regXwild.dotnet.targets\", \"$(onupkg)build\\netcoreapp/regXwild.targets\", true)]",
"#[IO copy.file(\"tools\\regXwild.dotnet.targets\", \"$(onupkg)build\\netcoreapp/regXwild.targets\", true)]",
"",
"#[IO copy.directory(\"\", \"$(onupkg)build\\netstandard\", true)]",
"#[IO copy.file(\"regXwild.dotnet.targets\", \"$(onupkg)build\\netstandard/regXwild.targets\", true)]",
""
]
}
},
{
"Enabled": true,
"Name": "BuildInfo",
"IgnoreIfBuildFailed": true,
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
"Command__": [
"#[var buildInfo = $([System.String]::Concat(\" \"))",
" regXwild #[$(rxwPrintVersion)]",
" ",
" ",
" Configuration: #[$(Configuration)]",
" ",
" Build version: #[$(revBuild)]",
" ",
" Branch Sha1: #[$(bSha1)]",
" ",
" ",
" :: generated by a vsSolutionBuildEvent #[$(vsSolutionBuildEvent)]",
"]",
"",
"#[IO writeLine(\"$(onupkg)/build-info.txt\"):#[$(buildInfo.Replace('\\n', '\\r\\n'))]]",
"",
"#[IO copy.file(\"tools\\regXwild.dotnet.targets\", \"$(onupkg)build\\netstandard/regXwild.targets\", true)]",
"",
"#[IO replace(\"$(onupkg)regXwild.nuspec\", \"{build-info}\", \"$(buildInfo)\")]"
]
Expand Down
16 changes: 1 addition & 15 deletions algo/algo.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\common.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -20,20 +21,13 @@
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7571CD36-4A3C-446F-96B1-951261274B78}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>net::r_eg::regXwild.algo</RootNamespace>
<PlatformToolset>v$(VisualStudioVersion.Replace(".", ""))</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)'==''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)'==''">10.0</WindowsTargetPlatformVersion>
<CharacterSet Condition="'$(CharacterSet)'==''">Unicode</CharacterSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(CharacterSet)'=='Unicode'">
<ClCompile>
<PreprocessorDefinitions>RXW_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
Expand Down Expand Up @@ -73,26 +67,18 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\raw\$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\</IntDir>
<IncludePath>$(ProjectDir);$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)bin\raw\$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\</IntDir>
<IncludePath>$(ProjectDir);$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\raw\$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\</IntDir>
<IncludePath>$(ProjectDir);$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)bin\raw\$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(ProjectDir)obj\$(Configuration)\</IntDir>
<IncludePath>$(ProjectDir);$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand Down
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ call %_gnt% /p:wpath="%cd%" /p:ngconfig="packages.config;snet\\packages.config"
set "__InitBuild=1" & call :build Win32 Unicode
endlocal

call :build x64 Unicode
call :build Win32 MultiByte
call :build x64 Unicode

setlocal
set "__FinalBuild=1" & call :build x64 MultiByte
Expand Down
27 changes: 27 additions & 0 deletions common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>

<PropertyGroup>
<CharacterSet Condition="'$(CharacterSet)'==''">Unicode</CharacterSet>
<DefineConstants Condition="'$(CharacterSet)'=='Unicode'">$(DefineConstants);RXW_UNICODE</DefineConstants>

<PlatformArch>$(Platform)</PlatformArch>
<PlatformArch Condition="'$(PlatformArch)'=='x86'">Win32</PlatformArch> <!-- unified paths due to regXwild.vcxproj -->

<OutRawDir>bin\raw\$(Configuration)\$(PlatformArch)\$(CharacterSet)\</OutRawDir>
<IntermediateOutputPath>..\bin\obj\$(MSBuildProjectName)\$(Configuration)\$(PlatformArch)\$(CharacterSet)\</IntermediateOutputPath>

<OutputPath>..\$(OutRawDir)\</OutputPath>
<OutDir>$([MSBuild]::Escape($([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(SolutionDir)`, `$(OutRawDir)`))`))))</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(CharacterSet)'=='Unicode'">
<ClCompile>
<PreprocessorDefinitions>RXW_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4480;4482;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>

</Project>
35 changes: 5 additions & 30 deletions dotnetTest/dotnetTest.csproj
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\common.props" />

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<Platforms>AnyCPU;x64;x86</Platforms>
</PropertyGroup>

<PropertyGroup>
<CharacterSet Condition="'$(CharacterSet)'==''">Unicode</CharacterSet>
<DefineConstants Condition="'$(CharacterSet)'=='Unicode'">$(DefineConstants);RXW_UNICODE</DefineConstants>
<Platforms>x64;x86</Platforms>
<Configurations>Debug;Release;PublicRelease</Configurations>
<NoWarn>1701;1702;CS1591;IDE1006</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\bin\raw\Debug\x64\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\bin\raw\Release\x64\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<OutputPath>..\bin\raw\Debug\Win32\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<OutputPath>..\bin\raw\Release\Win32\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\bin\raw\Debug\Win32\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\bin\raw\Release\Win32\</OutputPath>
<OutDir>$(OutDir)\$(MSBuildProjectName)\</OutDir>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 375a6d0

Please sign in to comment.