Skip to content

Commit

Permalink
(GH-28) added the current Cake.Recipe
Browse files Browse the repository at this point in the history
Also I introduced a "shim" project to create the NuGet package
instead of the nuspec and updated the README.
  • Loading branch information
nils-a committed Feb 6, 2021
1 parent dba5ec3 commit a2f7997
Show file tree
Hide file tree
Showing 25 changed files with 246 additions and 616 deletions.
19 changes: 19 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
image:
- Visual Studio 2019

test: off
build: off

skip_branch_with_pr: true
branches:
only:
- develop
- master
- /release/.*/
- /hotfix/.*/

build_script:
- ps: .\build.ps1 --target=CI

cache:
- tools -> recipe.cake
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.38.5",
"commands": [
"dotnet-cake"
]
}
}
}
21 changes: 21 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

*.cs text diff=csharp

*.ps1 text eol=crlf
*.bat text eol=crlf
*.sln text eol=crlf
*.csproj text eol=crlf
tasks.json text eol=crlf

*.sh text eol=lf

*.md text whitespace=-trailing-space

# Exclude files from exporting

.gitattributes export-ignore
.gitignore export-ignore
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ __pycache__/
*.pyc

# Cake - Uncomment if you are using it
tools/**
!tools/packages.config
tools/

dist/**
[Bb]uild[Aa]rtifacts/
/src/Cake.BuildSystems.Module/icon.png
34 changes: 34 additions & 0 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
create:
include-footer: true
footer-heading: Where to get it
footer-content: >
You can download this release from
[nuget](https://nuget.org/packages/Cake.BuildSystems.Module/{milestone}),
or you can just reference it in a cake build script
with `#module nuget:?package=Cake.BuildSystems.Module&version={milestone}`.
footer-includes-milestone: true
milestone-replace-text: "{milestone}"
export:
include-created-date-in-title: true
created-date-string-format: yyyy-MM-dd
perform-regex-removal: true
regex-text: '[\r\n]*### Where to get it[\r\n]*You can .*`\.[\r\n]*'
multiline-regex: true
issue-labels-include:
- Breaking change
- Bug
- Feature
- Enhancement
- Improvement
- Documentation
- security
issue-labels-exclude:
- Build
- Internal / Refactoring
issue-labels-alias:
- name: Documentation
header: Documentation
plural: Documentation
- name: security
header: Security
plural: Security
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Alistair Chapman
Copyright (c) 2017-2021 Alistair Chapman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ Each build system's functionality resides in its own module, with `Cake.Module.S

## Installation

### Using the latest bootstrapper
### Using the pre-processor directives

If you're using the latest bootstrapper example (always available in [this repo](https://github.com/cake-build/resources)), you can simply add a `tools/Modules/packages.config` file with the following contents:
Add the next following line to your Cake script:

```xml
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake.BuildSystems.Module" version="##see below for note on versioning##" />
</packages>
```cs
#module nuget:?package=Cake.BuildSystems.Module&version=##see below for note on versioning##
```

The next time you run the bootstrapper, the modules should be installed.
Note: The current version can always be taken from [nuget.org](https://nuget.org/packages/Cake.BuildSystems.Module/)).

Currently modules require "bootstrapping", so the first step before running the build is to call `dotnet cake --bootstrap`
(or `.\build.ps1 --bootstrap`)

### Other methods

You can also integrate this module into your own build process, even with a customised `build.ps1`/`build.sh`. As long as the `Cake.BuildSystems.Module` NuGet package is installed into your modules directory ([by default](http://cakebuild.net/docs/fundamentals/default-configuration-values) `./tools/Modules`), `cake.exe` should pick them up when it runs. Note that you can also change your modules directory using the `cake.config` file or passing arguments to `cake.exe` as outlined in [the documentation](http://cakebuild.net/docs/fundamentals/configuration)).
You can also integrate this module into your own build process, even with a customised `build.ps1`/`build.sh`. As long as the `Cake.BuildSystems.Module` NuGet package is installed into your modules directory ([by default](https://cakebuild.net/docs/running-builds/configuration/default-configuration-values) `./tools/Modules`), `cake.exe` should pick them up when it runs. Note that you can also change your modules directory using the `cake.config` file or passing arguments to `cake.exe` as outlined in [the documentation](https://cakebuild.net/docs/running-builds/configuration/set-configuration-values)).

### Versioning

Note that since modules interact with the internals of Cake, they are tied to a specific version of Cake. The version of Cake supported by the particular module version will always be in the Release Notes of the NuGet package (and therefore also on [nuget.org](https://nuget.org/packages/Cake.BuildSystems.Module/)). Make sure to match this version number to the Cake version you're using.

## Building

Running `build.ps1` with the default target will build all system modules into `dist/modules`. Copy this to `tools/Modules` (you may need to disable the MD5 check if using the bootstrapper) and run your script.
Running `build.ps1` with the default target will build all system modules into `BuildArtifacts/temp/_PublishedLibraries`. Copy this to `tools/Modules` (you may need to disable the MD5 check if using the bootstrapper) and run your script.
55 changes: 0 additions & 55 deletions ReleaseNotes.md

This file was deleted.

63 changes: 23 additions & 40 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,27 @@
pool:
vmImage: 'windows-latest'

trigger:
- master
- develop
branches:
include:
- master
- develop
- 'release/*'
- 'hotfix/*'
- 'feature/*'

variables:
buildConfiguration: 'Release'
cakeVersion: 0.38.5
sdkVersion: '2.2.300'
target: NuGet
tags:
include: []

pool:
vmImage: 'windows-2019'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK'
inputs:
packageType: sdk
version: $(sdkVersion)
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: NuGetToolInstaller@1
inputs:
versionSpec: '>=5.x'
- task: DotNetCoreCLI@2
displayName: Install Cake tool
inputs:
command: custom
custom: tool
arguments: install -g Cake.Tool --version $(cakeVersion)
- task: DotNetCoreCLI@2
displayName: Run build
inputs:
command: custom
custom: cake
arguments: --settings_skipverification=true --target=$(target)
- task: PublishPipelineArtifact@1
displayName: Publish packages artifact
inputs:
path: dist/package
artifact: package
- task: PublishPipelineArtifact@1
displayName: Publish build output
inputs:
path: dist/build
artifact: publish
- task: Cache@2
inputs:
key: '"$(Agent.OS)" | recipe.cake'
path: 'tools'
- task: Cake@2
inputs:
script: 'recipe.cake'
target: 'CI'
verbosity: 'Diagnostic'
Bootstrap: true
Version: '0.38.5'
Loading

0 comments on commit a2f7997

Please sign in to comment.