Skip to content

Commit

Permalink
remove nuspec file, use sdk style csproj instead, update buildscript,…
Browse files Browse the repository at this point in the history
… remove unused stuff
  • Loading branch information
FlorianAuinger committed Mar 17, 2022
1 parent 296daa4 commit 1f18354
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 81 deletions.
16 changes: 16 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project>
<PropertyGroup>
<Version>$(Version)</Version>

<Authors>Weingartner Maschinenbau GmbH</Authors>
<PackageProjectUrl>https://github.com/Weingartner/Migrations.Json.Net</PackageProjectUrl>
<RepositoryUrl>https://github.com/Weingartner/Migrations.Json.Net</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Description>Assists in migrating serialized JSON.Net objects</Description>
<Copyright>Weingartner Maschinenbau GmbH</Copyright>
<PackageTags>json migration</PackageTags>

</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>Weingartner.Json.Migration.Roslyn</PackageId>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>analyzers\dotnet\cs</ContentTargetFolders>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Weingartner.Json.Migration\Weingartner.Json.Migration.csproj" />
</ItemGroup>

<PropertyGroup>
<PackageId>Weingartner.Json.Migration.Analyzer</PackageId>

<ContentTargetFolders>analyzers\dotnet\cs</ContentTargetFolders>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddAnalyzersToOutput</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<PropertyGroup>
<NoWarn>1701;1702;NU5128</NoWarn>
</PropertyGroup>

<Target Name="_AddAnalyzersToOutput">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)\Weingartner.Json.Migration.Roslyn.dll" PackagePath="$(ContentTargetFolders)" />
</ItemGroup>
</Target>

<ItemGroup>
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
<Content Include="$(OutputPath)\Weingartner.Json.Migration.Roslyn.dll" PackagePath="$(ContentTargetFolders)" />
</ItemGroup>
<Import Project="..\Weingartner.Migration.Common.Shared\Weingartner.Migration.Common.Shared.projitems" Label="Shared" />

</Project>

8 changes: 3 additions & 5 deletions Weingartner.Json.Migration.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
# Visual Studio Version 17
VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Weingartner.Json.Migration.Roslyn_Vsix.Vsix", "Weingartner.Json.Migration.Roslyn.Vsix\Weingartner.Json.Migration.Roslyn_Vsix.Vsix.csproj", "{CD62CCCF-6F3C-43BF-BAEC-226012EA651E}"
EndProject
Expand All @@ -11,9 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Weingartner.Json.Migration.
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F53CBCC1-FBB0-462C-8935-0B853362A8AD}"
ProjectSection(SolutionItems) = preProject
base.nuspec = base.nuspec
scripts\build.fsx = scripts\build.fsx
nuget-build.ps1 = nuget-build.ps1
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Weingartner.Json.Migration.Roslyn.Spec", "Weingartner.Json.Migration.Roslyn.Spec\Weingartner.Json.Migration.Roslyn.Spec.csproj", "{34BF0AB4-8C34-4876-A2E3-20FAA72BD74A}"
Expand All @@ -25,7 +24,6 @@ EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Weingartner.Migration.Common.Shared\Weingartner.Migration.Common.Shared.projitems*{567ecd20-eb97-4a30-a5b2-0889d1609491}*SharedItemsImports = 5
Weingartner.Migration.Common.Shared\Weingartner.Migration.Common.Shared.projitems*{630bac68-a278-4bce-abf1-6c864b141aa0}*SharedItemsImports = 5
Weingartner.Migration.Common.Shared\Weingartner.Migration.Common.Shared.projitems*{d1ebb04a-a30b-43a6-a1a7-945bcfdf8ef0}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
8 changes: 7 additions & 1 deletion Weingartner.Json.Migration/Weingartner.Json.Migration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>Weingartner.Json.Migration</RootNamespace>
<AssemblyName>Weingartner.Json.Migration</AssemblyName>
<PackageId>Weingartner.Json.Migration</PackageId>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,4 +12,11 @@

<Import Project="..\Weingartner.Migration.Common.Shared\Weingartner.Migration.Common.Shared.projitems" Label="Shared" />

<PropertyGroup>
<PackageId>Weingartner.Json.Migration</PackageId>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>


</Project>
20 changes: 0 additions & 20 deletions base.nuspec

This file was deleted.

Binary file removed nuget.exe
Binary file not shown.
83 changes: 32 additions & 51 deletions scripts/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ Target.initEnvironment()

// Properties
let baseDir = (__SOURCE_DIRECTORY__ @@ "..") |> Path.GetFullPath
let buildOutputPath = @".\bin\Release"
let buildOutputs = !! @"**\bin"
let artifactPath = baseDir @@ "artifacts"
let slnPath = baseDir @@ "Weingartner.Json.Migration.sln"
let migrationProject = baseDir @@ "Weingartner.Json.Migration" @@ "Weingartner.Json.Migration.csproj"
let analyzerProject = baseDir @@ "Weingartner.Json.Migration.Roslyn" @@ "Weingartner.Json.Migration.Roslyn.csproj"

let gitVersion = Fake.Tools.GitVersion.generateProperties(id)

Expand All @@ -40,7 +42,6 @@ let msbuild target = (
"BuildParallel", "True"
"BuildProjectReferences", "True"
"DebugSymbols", "True"
"OutputPath", buildOutputPath
"Version", gitVersion.AssemblySemVer
]
NodeReuse = false
Expand All @@ -51,7 +52,8 @@ let msbuild target = (
// Targets
Target.create "Clean" (fun _ ->
Trace.trace "########################################### clean outputdir ###########################################"
Fake.IO.Shell.cleanDir buildOutputPath
buildOutputs |> Seq.iter Trace.trace
Fake.IO.Shell.cleanDirs buildOutputs
Fake.IO.Shell.cleanDir artifactPath
)

Expand All @@ -73,64 +75,43 @@ Target.create "RunTests" (fun _ ->
|> Seq.iter (fun dir -> dotnet "test" dir)
)

Target.create "PackNugetMigration" (fun _ ->
let packMSBuildParams = {
MSBuild.CliArguments.Create() with
ToolsVersion = (Some "Current")
Properties =
[
"Configuration", "Release"
"Version", gitVersion.SemVer
]
NodeReuse = false
}

let workingDir = @".\Weingartner.Json.Migration" @@ buildOutputPath
NuGet.NuGetPack (fun p -> {
p with
Authors = ["Weingartner Maschinenbau GmbH"]
Project = "Weingartner.Json.Migration"
Description = "Assists in migrating serialized JSON.Net objects"
OutputPath = artifactPath
DependenciesByFramework = [
{ FrameworkVersion = "netstandard2.0"
Dependencies = [
"Newtonsoft.Json", "13.0.1"
]}
]
Files = [ ("Weingartner*.dll", Some("lib/netstandard2.0"), None )]
Summary = "Assists in migrating serialized JSON.Net objects"
Version = gitVersion.SemVer
WorkingDir = workingDir
Publish = false
})
"./base.nuspec"
Target.create "PackNugetMigration" (fun _ ->
DotNet.pack (fun defaults -> {
defaults with
OutputPath = Some artifactPath
MSBuildParams = packMSBuildParams
NoRestore = true
NoBuild = true
})
migrationProject
)

Target.create "PackNugetAnalyzer" (fun _ ->

let workingDir = @".\Weingartner.Json.Migration.Roslyn" @@ buildOutputPath

NuGet.NuGetPack (fun p -> {
p with
Authors = ["Weingartner Maschinenbau GMBH"]
Project = "Weingartner.Json.Migration.Analyzer"
Description = "Assists in migrating serialized JSON.Net objects"
OutputPath = artifactPath
DependenciesByFramework = [
{ FrameworkVersion = "netstandard2.0"
Dependencies = [
"Weingartner.Json.Migration", gitVersion.SemVer
"Newtonsoft.Json", "13.0.1"
]}
]
Summary = "Assists in migrating serialized JSON.Net objects"
Version = gitVersion.SemVer
WorkingDir = workingDir
Files = [
( "Weingartner.Json.Migration.Roslyn.dll", Some "analyzers/dotnet/cs", Some "**/Microsoft.*;**/System.*")
( "tools/**/*.*", None, None)
]
Publish = false
})
"./base.nuspec"
DotNet.pack (fun defaults -> {
defaults with
OutputPath = Some artifactPath
MSBuildParams = packMSBuildParams
NoRestore = true
NoBuild = true
})
analyzerProject
)

Target.create "Default" (fun _ ->
Trace.trace "Finished"
)


// Dependencies
"Clean"
==> "BuildSolution"
Expand Down

0 comments on commit 1f18354

Please sign in to comment.