Skip to content

Update build system #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2.1

orbs:
win: circleci/windows@2.2.0

jobs:
build:
executor: win/default

steps:
- checkout
- run: npm ci --no-progress
- run: npm run dump-env
- run: npm test
- run: npm run release
- store_artifacts:
path: build/package/log4net.2.0.9.nupkg
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
Expand Down Expand Up @@ -235,3 +235,11 @@ target
# other files to ignore
old-log4net.snk
src/GeneratedAssemblyInfo.cs
.idea
*.orig
*.old
*.swp
build-tools
buildreports
vs_buildtools.exe
dotnetfx35.exe
33 changes: 33 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Building log4net

Log4net provides support for a wide array of targets, including
- older .net 2 and 3.5 (including client profiles)
- more modern net40/net45
- netstandard1.3/2.0

As such, it does require a relatively full .net environment on Windows to build.

Options:
- build locally. Suggested environment:
- Pre-requisites:
- Visual Studio 2019 Build Tools
- include desktop targets at least
- include dotnet core targets or download and install
the latest dotnet sdk (you will need at least v2.1)
- Ensure you have .NET Framework 3.5 SP1 installed
- on Win10+, this can only be installed via Add/Remove Windows Components
- on other platforms, see https://dotnet.microsoft.com/download/dotnet-framework/net35-sp1
- Building against .net 2/3.5, especially Client Profile, is not supported on Mono
- Binaries can be built with a Visual Studio or Rider installation
- Binaries, packages and a release zip can be built via commandline
- Ensure that you have a reasonably modern NodeJS installed (at least version 8+)
- `npm ci`
- `npm run build`
- optionally `npm test` to run all tests
- optionally `npm run release` to generate release artifacts
- build via the vs2019 Windows AppVeyer image. There is an appveyer.yml file
included which (should) build if you set up AppVeyer to track
your fork. AppVeyer is free for open-source projects.
(TODO: should have a link to the official AppVeyer build)
- build via the CircleCI Windows image. There is included configuration for CircleCI.
CicleCI is free (with usage limitations) for open-source projects.
10 changes: 10 additions & 0 deletions appveyer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 1.0.{build}
image: Visual Studio 2019
build_script:
- cmd: >-
npm ci
npm test
npm run release

artifacts:
- path: build/artifacts/*
1 change: 1 addition & 0 deletions build-with-docker-for-windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -v %~dp0%:C:\dev -v %USERPROFILE%\.nuget\packages:C:\packages -t davydm/net-build-tools:vs2019 "npm ci; npm run build"
6 changes: 6 additions & 0 deletions install-net-framework-3.5.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Write-Host "Downloading dotnetfx35.exe"
Invoke-WebRequest -Uri "https://download.microsoft.com/download/2/0/E/20E90413-712F-438C-988E-FDAA79A8AC3D/dotnetfx35.exe" -OutFile dotnetfx35.exe
Write-Host "Running dotnetfx35.exe"
Start-Process -FilePath dotnetfx35.exe -ArgumentList "/wait","/passive" -Wait
Write-Host "dotnetfx35 installed"

14 changes: 14 additions & 0 deletions local-tasks/zip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const
gulp = requireModule("gulp-with-help"),
promisify = requireModule("promisify-stream"),
readNuspecVersion = requireModule("read-nuspec-version"),
zip = require("gulp-zip");

gulp.task("zip", async () => {
const version = await readNuspecVersion("log4net.nuspec");
return promisify(
gulp.src("build/Release/**/*")
.pipe(zip(`log4net-binaries-${version}.zip`))
.pipe(gulp.dest("build/artifacts"))
);
});
102 changes: 68 additions & 34 deletions log4net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,62 +32,96 @@ At the same time, log output can be so voluminous that it quickly becomes overwh
log4net is designed with two distinct goals in mind: speed and flexibility</description>
<authors>The Apache Software Foundation</authors>
<owners>Apache Logging Project, Jiří Činčura</owners>
<licenseUrl>http://logging.apache.org/log4net/license.html</licenseUrl>
<license type="expression">Apache-2.0</license>
<projectUrl>http://logging.apache.org/log4net/</projectUrl>
<iconUrl>https://www.apache.org/images/feather.png</iconUrl>
<icon>package-icon.png</icon>
<copyright>Copyright 2004-2017 The Apache Software Foundation</copyright>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>logging log tracing logfiles</tags>
<dependencies>
<group targetFramework="net20-full" />
<group targetFramework="net35-full" />
<group targetFramework="net40-full" />
<group targetFramework="net45-full" />
<group targetFramework="net20" />
<group targetFramework="net35" />
<group targetFramework="net40" />
<group targetFramework="net45" />
<group targetFramework="net35-client" />
<group targetFramework="net40-client" />
<group targetFramework=".NETStandard1.3">
<dependency id="System.AppContext" version="[4.1.0, )" />
<group targetFramework="netstandard1.3">
<dependency id="System.AppContext" version="[4.3.0, )" />
<dependency id="System.Collections.NonGeneric" version="[4.0.1, )" />
<dependency id="System.Console" version="[4.0.0, )" />
<dependency id="System.Diagnostics.Debug" version="[4.0.11, )" />
<dependency id="System.Console" version="[4.3.0, )" />
<dependency id="System.Diagnostics.Debug" version="[4.3.0, )" />
<dependency id="System.Diagnostics.Process" version="[4.1.0, )" />
<dependency id="System.Diagnostics.StackTrace" version="[4.0.1, )" />
<dependency id="System.Diagnostics.TraceSource" version="[4.0.0, )" />
<dependency id="System.IO.FileSystem" version="[4.0.1, )" />
<dependency id="System.IO.FileSystem" version="[4.3.0, )" />
<dependency id="System.IO.FileSystem.Watcher" version="[4.0.0, )" />
<dependency id="System.Linq" version="[4.1.0, )" />
<dependency id="System.Linq" version="[4.3.0, )" />
<dependency id="System.Net.NameResolution" version="[4.0.0, )" />
<dependency id="System.Net.Requests" version="[4.0.11, )" />
<dependency id="System.Net.Sockets" version="[4.1.0, )" />
<dependency id="System.Net.Sockets" version="[4.3.0, )" />
<dependency id="System.Reflection" version="[4.3.0, )" />
<dependency id="System.Reflection.Extensions" version="[4.0.1, )" />
<dependency id="System.Reflection.Extensions" version="[4.3.0, )" />
<dependency id="System.Reflection.TypeExtensions" version="[4.1.0, )" />
<dependency id="System.Runtime.Extensions" version="[4.1.0, )" />
<dependency id="System.Runtime.InteropServices" version="[4.1.0, )" />
<dependency id="System.Runtime.InteropServices.RuntimeInformation" version="[4.0.0, )" />
<dependency id="System.Runtime.Extensions" version="[4.3.0, )" />
<dependency id="System.Runtime.InteropServices" version="[4.3.0, )" />
<dependency id="System.Runtime.InteropServices.RuntimeInformation" version="[4.3.0, )" />
<dependency id="System.Runtime.Serialization.Formatters" version="[4.3.0, )" />
<dependency id="System.Text.RegularExpressions" version="[4.1.0, )" />
<dependency id="System.Threading" version="[4.0.11, )" />
<dependency id="System.Text.RegularExpressions" version="[4.3.0, )" />
<dependency id="System.Text.Encoding" version="[4.3.0, )" />
<dependency id="System.Threading" version="[4.3.0, )" />
<dependency id="System.Threading.Thread" version="[4.0.0, )" />
<dependency id="System.Threading.Timer" version="[4.0.1, )" />
<dependency id="System.Xml.ReaderWriter" version="[4.0.11, )" />
<dependency id="System.Threading.Timer" version="[4.3.0, )" />
<dependency id="System.Xml.ReaderWriter" version="[4.3.0, )" />
<dependency id="System.Xml.XmlDocument" version="[4.0.1, )" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="System.AppContext" version="[4.3.0, )" />
<dependency id="System.Collections.NonGeneric" version="[4.0.1, )" />
<dependency id="System.Console" version="[4.3.0, )" />
<dependency id="System.Diagnostics.Debug" version="[4.3.0, )" />
<dependency id="System.Diagnostics.Process" version="[4.1.0, )" />
<dependency id="System.Diagnostics.StackTrace" version="[4.0.1, )" />
<dependency id="System.Diagnostics.TraceSource" version="[4.0.0, )" />
<dependency id="System.IO.FileSystem" version="[4.3.0, )" />
<dependency id="System.IO.FileSystem.Watcher" version="[4.0.0, )" />
<dependency id="System.Linq" version="[4.3.0, )" />
<dependency id="System.Net.NameResolution" version="[4.0.0, )" />
<dependency id="System.Net.Requests" version="[4.0.11, )" />
<dependency id="System.Net.Sockets" version="[4.3.0, )" />
<dependency id="System.Reflection" version="[4.3.0, )" />
<dependency id="System.Reflection.Extensions" version="[4.3.0, )" />
<dependency id="System.Reflection.TypeExtensions" version="[4.1.0, )" />
<dependency id="System.Runtime.Extensions" version="[4.3.0, )" />
<dependency id="System.Runtime.InteropServices" version="[4.3.0, )" />
<dependency id="System.Runtime.InteropServices.RuntimeInformation" version="[4.3.0, )" />
<dependency id="System.Runtime.Serialization.Formatters" version="[4.3.0, )" />
<dependency id="System.Text.RegularExpressions" version="[4.3.0, )" />
<dependency id="System.Text.Encoding" version="[4.3.0, )" />
<dependency id="System.Threading" version="[4.3.0, )" />
<dependency id="System.Threading.Thread" version="[4.0.0, )" />
<dependency id="System.Threading.Timer" version="[4.3.0, )" />
<dependency id="System.Xml.ReaderWriter" version="[4.3.0, )" />
<dependency id="System.Xml.XmlDocument" version="[4.0.1, )" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin\net\2.0\release\log4net.dll" target="lib\net20-full" />
<file src="bin\net\2.0\release\log4net.xml" target="lib\net20-full" />
<file src="bin\net\3.5\release\log4net.dll" target="lib\net35-full" />
<file src="bin\net\3.5\release\log4net.xml" target="lib\net35-full" />
<file src="bin\net\4.0\release\log4net.dll" target="lib\net40-full" />
<file src="bin\net\4.0\release\log4net.xml" target="lib\net40-full" />
<file src="bin\net\4.5\release\log4net.dll" target="lib\net45-full" />
<file src="bin\net\4.5\release\log4net.xml" target="lib\net45-full" />
<file src="bin\net-cp\3.5\release\log4net.dll" target="lib\net35-client" />
<file src="bin\net-cp\3.5\release\log4net.xml" target="lib\net35-client" />
<file src="bin\net-cp\4.0\release\log4net.dll" target="lib\net40-client" />
<file src="bin\net-cp\4.0\release\log4net.xml" target="lib\net40-client" />
<file src="bin\netstandard\1.3\Release\log4net.dll" target="lib\netstandard1.3" />
<file src="package-icon.png" target="" />
<file src="build\Release\net20\log4net.dll" target="lib\net20" />
<file src="build\Release\net20\log4net.xml" target="lib\net20" />
<file src="build\Release\net35\log4net.dll" target="lib\net35" />
<file src="build\Release\net35\log4net.xml" target="lib\net35" />
<file src="build\Release\net40\log4net.dll" target="lib\net40" />
<file src="build\Release\net40\log4net.xml" target="lib\net40" />
<file src="build\Release\net45\log4net.dll" target="lib\net45" />
<file src="build\Release\net45\log4net.xml" target="lib\net45" />
<file src="build\Release\net35-client\log4net.dll" target="lib\net35-client" />
<file src="build\Release\net35-client\log4net.xml" target="lib\net35-client" />
<file src="build\Release\net40-client\log4net.dll" target="lib\net40-client" />
<file src="build\Release\net40-client\log4net.xml" target="lib\net40-client" />
<file src="build\Release\netstandard1.3\log4net.dll" target="lib\netstandard1.3" />
<file src="build\Release\netstandard1.3\log4net.xml" target="lib\netstandard1.3" />
<file src="build\Release\netstandard2.0\log4net.dll" target="lib\netstandard2.0" />
<file src="build\Release\netstandard2.0\log4net.xml" target="lib\netstandard2.0" />
</files>
</package>
Binary file added package-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading