Skip to content

Commit 731dabe

Browse files
committed
Code Refactoring + add nuget build
1 parent 2cc60a0 commit 731dabe

File tree

206 files changed

+413
-310
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+413
-310
lines changed

Directory.Build.props

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

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Courio-Dev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

PuzzleCMS.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{938F61AB-A71
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Host", "Host", "{09455435-891C-4583-BD89-247FCF26C3E1}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PuzzleCMS.WebHost", "src\Host\PuzzleCMS.WebHost\PuzzleCMS.WebHost.csproj", "{1F6A83DC-65CA-435B-93DF-69E5295668B1}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PuzzleCMS.Web.Hosting", "src\PuzzleCMS.Web.Hosting\PuzzleCMS.Web.Hosting.csproj", "{1F6A83DC-65CA-435B-93DF-69E5295668B1}"
1111
EndProject
12-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core.Mvc", "Core.Mvc", "{4C1D4A63-1206-4948-BC79-FEE4BB87C27F}"
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PuzzleCMS.Core", "PuzzleCMS.Core", "{4C1D4A63-1206-4948-BC79-FEE4BB87C27F}"
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solutions Items", "Solutions Items", "{81CBA0A8-63C5-47E1-A9D8-741F81C6ED78}"
1515
ProjectSection(SolutionItems) = preProject
@@ -19,7 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solutions Items", "Solution
1919
testsandcoverage.bat = testsandcoverage.bat
2020
EndProjectSection
2121
EndProject
22-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Puzzle.Core.Multitenancy", "src\Core.Mvc\Puzzle.Core.Multitenancy\Puzzle.Core.Multitenancy.csproj", "{93C0E47A-8F09-476E-B279-8522CD3A0109}"
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PuzzleCMS.Core.Multitenancy", "src\PuzzleCMS.Core\PuzzleCMS.Core.Multitenancy\PuzzleCMS.Core.Multitenancy.csproj", "{93C0E47A-8F09-476E-B279-8522CD3A0109}"
2323
EndProject
2424
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{C46235CA-CF95-4644-BC9C-3F5339321DA3}"
2525
EndProject

build.cake

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ Task("Remove-Packages").Does(() =>CleanDirectory(paths.Directories.ArtifactNuget
252252
Task("Copy-Files")
253253
.DoesForEach(paths.Files.AllNuspecsProjects,projectNuSpecToPack =>
254254
{
255+
/*
255256
var nuspecFile = projectNuSpecToPack.FullPath;
256257
var csprojFile = projectNuSpecToPack.ChangeExtension(".csproj");
257258
@@ -270,6 +271,7 @@ Task("Copy-Files")
270271
271272
// Copy license
272273
//CopyFileToDirectory("./LICENSE", outputDirectory21);
274+
*/
273275

274276
});
275277

@@ -285,15 +287,18 @@ Task("Package-NuGet")
285287
{
286288
// .NET Core
287289
var nuspecFile=projectNuSpecToPack.FullPath;
290+
var csprojFile = projectNuSpecToPack.ChangeExtension(".csproj");
288291
var fullBasePath = GetOutputArtifactFromProjectFile(paths.Directories.ArtifactsBinNetCoreapp21,nuspecFile);
289-
// normal
290-
NuGetPack(nuspecFile, new NuGetPackSettings {
291-
Version = buildVersion.Version,
292-
BasePath = fullBasePath,
293-
OutputDirectory = paths.Directories.ArtifactNugetsDirectory,
294-
Symbols = false,
295-
NoPackageAnalysis = true
292+
293+
DotNetCorePack(csprojFile.FullPath,new DotNetCorePackSettings()
294+
{
295+
Configuration = configuration,
296+
OutputDirectory = paths.Directories.ArtifactNugetsDirectory,
297+
VersionSuffix = buildVersion.VersionSuffix,
298+
NoRestore=true,
299+
NoBuild=true
296300
});
301+
297302
});
298303

299304
//////////////////////////////////////////////////////////////////////

build/paths.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class BuildPaths
3939
public BuildDirectories Directories { get; private set; }
4040

4141
private static FilePath SolutionFile => "./PuzzleCMS.sln";
42-
private static FilePath VersionFile => "./version.props";
42+
private static FilePath VersionFile => "./directory.build/version.props";
4343

4444
public static FilePath ArtifactCodeCoverageResultFile => "coverage.xml";
4545
public static DirectoryPath ArtifactCodeCoverageReportDirectory => "coverage";
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
3+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netcoreapp2.1' ">
4+
<DefineConstants>LIBLOG_PORTABLE</DefineConstants>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<SolutionDir>$([System.IO.Path]::GetDirectoryName($(MSBuildProjectDirectory)))\</SolutionDir>
9+
</PropertyGroup>
10+
11+
<Import Project="Directory.Version.props" />
12+
<Import Project="Directory.Dependencies.Commons.props" />
13+
<Import Project="Directory.CodeAnalysis.props" />
14+
15+
<ItemGroup>
16+
<Content Include="README.md"><Pack>true</Pack><PackagePath>..\</PackagePath></Content>
17+
<Content Include="LICENSE"><Pack>true</Pack><PackagePath>LICENSE</PackagePath></Content>
18+
</ItemGroup>
19+
20+
<PropertyGroup Label="Common Package">
21+
<Copyright>Copyright (c) Courio-Dev and contributors. All rights reserved.</Copyright>
22+
<Description>Description</Description>
23+
<Authors>Courio-Dev</Authors>
24+
<Company>Courio-Dev</Company>
25+
<PackageProjectUrl>https://github.com/Courio-Dev/UnobtrusiveMultitenancy</PackageProjectUrl>
26+
<PackageLicenseUrl>https://github.com/Courio-Dev/UnobtrusiveMultitenancy/blob/master/LICENSE</PackageLicenseUrl>
27+
<PackageIconUrl>https://github.com/Courio-Dev/UnobtrusiveMultitenancy</PackageIconUrl>
28+
<RepositoryUrl>https://github.com/Courio-Dev/UnobtrusiveMultitenancy</RepositoryUrl>
29+
<RepositoryType>git</RepositoryType>
30+
<PackageTags>
31+
multitenancy
32+
multitenant
33+
multitenant-applications
34+
tenant
35+
dependency-injection
36+
aspnet-core-2
37+
aspnet-core-mvc
38+
net-core-2
39+
</PackageTags>
40+
</PropertyGroup>
41+
42+
<!-- Use for debug -->
43+
<!-- https://chimpiq.com/msbuild-part-3/ -->
44+
<!-- https://stackoverflow.com/questions/2111256/how-can-i-get-current-directory-in-msbuild-script -->
45+
<!-- https://www.newventuresoftware.com/blog/code-bites-copying-output-files-after-build-using-msbuild -->
46+
<!-- http://sedodream.com/2008/06/09/MSBuildReservedProperties.aspx -->
47+
<!-- http://sedodream.com/2007/11/21/MSBuildHowToGetAllGeneratedOutputs.aspx -->
48+
<!-- https://blogs.msdn.microsoft.com/visualstudio/2010/07/06/debugging-msbuild-script-with-visual-studio/ -->
49+
<!-- https://natemcmaster.com/blog/2017/07/05/msbuild-task-in-nuget/ -->
50+
<Target Name="Display SetPackageProperties" BeforeTargets="SetPackageProperties">
51+
<Message Text="$(PackageId)" Importance="high"/>
52+
<Message Text="$(PackageVersion)" Importance="high"/>
53+
<Message Text="$(Configuration)" Importance="high"/>
54+
<Message Text="$(PackageTags.Replace(';',' '))" Importance="high"/>
55+
<Message Text="$(PackageProjectUrl)" Importance="high"/>
56+
<Message Text="$(PackageLicenseUrl)" Importance="high"/>
57+
<Message Text="$(PackageIconUrl)" Importance="high"/>
58+
<Message Text="$(RepositoryUrl)" Importance="high"/>
59+
<Message Text="$(RepositoryType)" Importance="high"/>
60+
<Message Text="$(Authors)" Importance="high"/>
61+
<Message Text="$(Copyright)" Importance="high"/>
62+
<Message Text="$(Description)" Importance="high"/>
63+
<Message Text="OutputPath: $(OutputPath)" Importance="high"/>
64+
<Message Text="MSBuildProjectDirectory: $(MSBuildProjectDirectory)" Importance="high"/>
65+
66+
<Message Text="PublishDir: $(PublishDir)" Importance="high"/>
67+
<Message Text="SolutionDir: $(SolutionDir)" Importance="high"/>
68+
<Message Text="OutputShims: $(IntermediateOutputPath)shims\$(TargetFramework)" Importance="high"/>
69+
<Message Text="OutputBinary: $(MSBuildProjectDirectory)\$(OutputPath)" Importance="high"/>
70+
<Message Text="OutputRuntimeConfig: $(MSBuildProjectDirectory)\netcoreapp2.0\$(PackageId).runtimeconfig.json" Importance="high"/>
71+
<Message Text="OutputSymbol: $(MSBuildProjectDirectory)\netcoreapp2.0\$(PackageId).pdb" Importance="high"/>
72+
</Target>
73+
74+
<Target Name="SetPackageProperties" BeforeTargets="GenerateNuspec">
75+
<PropertyGroup>
76+
<IncludeSymbols>true</IncludeSymbols>
77+
<NuspecProperties>
78+
id=$(PackageId);
79+
version=$(PackageVersion);
80+
configuration=$(Configuration);
81+
tags=$(PackageTags.Replace("&amp;", "&amp;amp;"));
82+
projectUrl=$(PackageProjectUrl);
83+
licenseUrl=$(PackageLicenseUrl);
84+
iconUrl=$(PackageIconUrl);
85+
repositoryUrl=$(RepositoryUrl);
86+
repositoryType=$(RepositoryType);
87+
author=$(Authors);
88+
copyright=$(Copyright);
89+
description=$(Description);
90+
91+
OutputBaseBinary=$(MSBuildProjectDirectory)\$(OutputPath);
92+
</NuspecProperties>
93+
</PropertyGroup>
94+
</Target>
95+
96+
<PropertyGroup Label="Source Link">
97+
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
98+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
99+
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
100+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
101+
<!-- Optional: Include PDB in the built .nupkg -->
102+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
103+
</PropertyGroup>
104+
105+
<PropertyGroup Label="Package Versions">
106+
<AspNetCoreVersion>2.1.1</AspNetCoreVersion>
107+
<XunitVersion>2.3.1</XunitVersion>
108+
<XunitAnalyzersVersion>0.8.0</XunitAnalyzersVersion>
109+
</PropertyGroup>
110+
111+
</Project>
File renamed without changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
</Project>
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<PropertyGroup>
3-
<VersionPrefix>0.1.1</VersionPrefix>
3+
<VersionPrefix>1.0.0</VersionPrefix>
44
<VersionSuffix>preview</VersionSuffix>
55
<Version>$(VersionPrefix)</Version>
66
<AssemblyVersion>$(VersionPrefix)</AssemblyVersion>
77
<FileVersion>$(VersionPrefix)</FileVersion>
88
<ExperimentalProjectVersionPrefix>$(VersionPrefix)</ExperimentalProjectVersionPrefix>
9+
<NetStandardImplicitPackageVersion>2.0.0-*</NetStandardImplicitPackageVersion>
10+
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
11+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
12+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
913
</PropertyGroup>
1014
</Project>

0 commit comments

Comments
 (0)