Skip to content

Commit

Permalink
build: add package properties (#63)
Browse files Browse the repository at this point in the history
split Version into VersionPrefix and VersionSuffix
fix test ProjectReference
  • Loading branch information
Flash0ver authored Nov 9, 2023
1 parent 226e962 commit e7a6ecb
Show file tree
Hide file tree
Showing 15 changed files with 252 additions and 28 deletions.
31 changes: 31 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
* text=auto

*.config text
*.cs text diff=csharp
*.cshtml text
*.csproj text
*.css text diff=css
*.editorconfig text
*.globalconfig text
*.htm text diff=html
*.html text diff=html
*.json text
*.md text diff=markdown
*.props text
*.ps1 text
*.razor text
*.resx text
*.runsettings text
*.sln text
*.slnf text
*.targets text
*.txt text
*.vb text
*.vbproj text
*.vsixmanifest text
*.xaml text
*.xml text
*.yaml text
*.yml text

*.png binary
132 changes: 130 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand All @@ -23,6 +23,7 @@ mono_crash.*
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
Expand Down Expand Up @@ -56,11 +57,17 @@ dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
# .NET
project.lock.json
project.fragment.lock.json
artifacts/

# Tye
.tye/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

Expand All @@ -86,6 +93,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -137,6 +145,11 @@ _TeamCity*
.axoCover/*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
*.coveragexml
Expand Down Expand Up @@ -284,6 +297,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -340,6 +364,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -349,6 +376,107 @@ MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
.idea/
*.sln.iml

##
## Visual studio for Mac
##


# globs
Makefile.in
*.userprefs
*.usertasks
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.tar.gz
tarballs/
test-results/

# Mac bundle stuff
*.dmg
*.app

# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# NUKE
.nuke/temp/
.nuke/build.schema.json
3 changes: 2 additions & 1 deletion .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "./build.schema.json",
"Solution": "src/FlashOWare.Tool.sln",
"Version": "1.0.0-prerelease0",
"VersionPrefix": "1.0.0",
"VersionSuffix": "prerelease0",
"NuGetSource": "https://api.nuget.org/v3/index.json"
}
8 changes: 8 additions & 0 deletions docs/CHANGELOG-Prerelease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FlashOWare.Tool
Prerelease Changelog

[goto Release_Changelog;](./CHANGELOG.md)

## [vNext]

[vnext]: https://github.com/FlashOWare/FlashOWare.Tool
8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FlashOWare.Tool
Release Changelog

[goto Prerelease_Changelog;](./CHANGELOG-Prerelease.md)

## [vNext]

[vnext]: https://github.com/FlashOWare/FlashOWare.Tool
8 changes: 8 additions & 0 deletions docs/Index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# FlashOWare.Tool

## Documentation
TODO

## Changelogs
- [Release Changelog](./CHANGELOG.md)
- [Prerelease Changelog](./CHANGELOG-Prerelease.md)
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"rollForward": "feature"
}
}
7 changes: 7 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Binary file added resources/FlashOWare.Tool-Prerelease.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/FlashOWare.Tool-Preview.png
Binary file not shown.
2 changes: 2 additions & 0 deletions resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# About
A .NET tool that facilitates development workflows.
29 changes: 13 additions & 16 deletions src/build/FlashOWare.Tool.Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@
ImportSecrets = new[] { nameof(NuGetApiKey) })]
class Build : NukeBuild
{
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode

public static int Main () => Execute<Build>(x => x.Compile);
public static int Main() => Execute<Build>(x => x.Compile);

[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
Expand All @@ -55,11 +49,12 @@ class Build : NukeBuild

[Solution] readonly Solution Solution;

[Parameter] readonly string Version;
[Parameter] readonly string VersionPrefix;
[Parameter] readonly string VersionSuffix;

[Parameter] readonly string NuGetSource;

[Parameter] [Secret] readonly string NuGetApiKey;
[Parameter][Secret] readonly string NuGetApiKey;

Target Restore => _ => _
.Executes(() =>
Expand All @@ -86,24 +81,26 @@ class Build : NukeBuild
.DependsOn(Compile)
.Executes(() =>
{
DotNetTest(_ => _
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.SetNoBuild(FinishedTargets.Contains(Compile))
.SetResultsDirectory(TestResultsDirectory));
DotNetTest(_ => _
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.SetNoBuild(FinishedTargets.Contains(Compile))
.SetResultsDirectory(TestResultsDirectory));
});

Target Pack => _ => _
.DependsOn(Compile)
.Requires(() => Version)
.Requires(() => VersionPrefix)
.Requires(() => VersionSuffix)
.Executes(() =>
{
DotNetPack(_ => _
.SetProject(Solution)
.SetConfiguration(Configuration)
.SetNoBuild(FinishedTargets.Contains(Compile))
.EnableNoLogo()
.SetVersion(Version)
.SetVersionPrefix(VersionPrefix)
.SetVersionSuffix(VersionSuffix)
.SetOutputDirectory(PackageDirectory)
.SetProcessExitHandler(p => p.ExitCode switch
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\tools\FlashOWare.Tool\FlashOWare.Tool.csproj" />
<ProjectReference Include="..\..\libraries\FlashOWare.Tool.Cli\FlashOWare.Tool.Cli.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit e7a6ecb

Please sign in to comment.