Skip to content
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

tabs to spaces #117

Merged
merged 14 commits into from
Mar 8, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,5 @@ vs_buildtools.exe
dotnetfx35.exe
*.exe
/src/Binaries/*

local-tasks/*.generated.js
11 changes: 11 additions & 0 deletions .zarro-defaults
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ MAX_CONCURRENCY=1

# specify what to build (prevents accidental build of any other sln)
BUILD_INCLUDE=src/log4net.sln

# using zarro's pack target, tell it what to pack
PACK_INCLUDE_CSPROJ=log4net.csproj
# the pack target increments the PackageVersion node in log4net.csproj
# - setting this "truthy" propagates that change to the Version node
PACK_SYNC_PROJECT_VERSION=1
# all version changes should be manual, however, it's generally
# accepted that the beta for, eg, 1.2.3 is 1.2.3-{date}-{sha}
# ie beta packages carry the main version of their intended
# release version
PACK_INCREMENT_MINOR_ON_FIRST_RELEASE=0
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Apache log4net
Copyright 2004-2022 The Apache Software Foundation
Copyright 2004-2024 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
33 changes: 31 additions & 2 deletions doc/BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
## Building log4net

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

As such, it does require a relatively full .net environment on Windows to build.
I have recently found a fairly freshly-installed win11 machine to work adequately,
after adding the "windows feature" for ".NET Framework 3.5 (includes .NET 2.0 and 3.0)"

TL;DR (Windows):
- install Visual Studio Build Tools (at least VS2019)
- install nodejs (at least v16)
- install dotnet (v7+) and the .NET SDK (current latest)
- install dotnet 2, 3, 3.5 via "add windows features"
- in the project folder:
- `npm i`
- `npm run build`

TL;DR (!Windows):
- install the dotnet SDK - v7 or better (at time of writing, v8 is current but
I've had some issues elsewhere, so I'm waiting a bit before recommending it
everywhere
- install Mono (you're going to need it to target certain versions of .NET)
- install nodejs 16+
- in the project folder:
- `npm i`
- `export DOTNET_CORE=1 npm run build`
- we force using `dotnet` on non-windows targets for now. At some point,
this should become automatic

## The full story

Options:
- build locally. Suggested environment:
Expand Down Expand Up @@ -35,6 +60,10 @@ Options:
- `npm run build`
- optionally `npm test` to run all tests
- optionally `npm run release` to generate release artifacts
- build locally (CLI edition)
- install nodejs (at least v16)
- `npm i`
- `npm run build`
- build via docker for windows, using the `build-with-docker-for-windows.bat` script
- build via the vs2019 Windows AppVeyer image. There is an appveyer.yml file
included which (should) build if you set up AppVeyer to track
Expand All @@ -54,4 +83,4 @@ The site will be generated in `target/site`, and can be viewed locally. Updates
be pushed to the `asf-staging` branch of [https://github.com/apache/logging-log4net-site](https://github.com/apache/logging-log4net-site])

Once the site has been pushed to the `asf-staging` branch, it can be viewed at
[http://logging.staged.apache.org/log4net](http://logging.staged.apache.org/log4net)
[http://logging.staged.apache.org/log4net](http://logging.staged.apache.org/log4net)
53 changes: 27 additions & 26 deletions local-tasks/build-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -16,32 +16,33 @@
// under the License.

const
gulp = requireModule("gulp"),
spawn = requireModule("spawn"),
env = requireModule("env"),
os = require("os"),
which = require("which");
gulp = requireModule("gulp"),
spawn = requireModule("spawn"),
env = requireModule("env"),
os = require("os"),
which = require("which");

gulp.task("build-site", async () => {
let maven;
try {
maven = await which("mvn");
} catch (e) {
let extra;
switch (os.platform()) {
case "win32":
extra = "You may install maven via chocolatey (https://chocolatey.org)";
break;
case "darwin":
extra = "You may install maven via homebrew";
break;
default:
extra = "You should install maven with your package manager";
break;
}
throw new Error(`Unable to find mvn in your path. ${extra}`);
const { rm } = require("yafs");
let maven;
try {
maven = await which("mvn");
} catch (e) {
let extra;
switch (os.platform()) {
case "win32":
extra = "You may install maven via chocolatey (https://chocolatey.org)";
break;
case "darwin":
extra = "You may install maven via homebrew";
break;
default:
extra = "You should install maven with your package manager";
break;
}

return spawn("mvn", [ "site" ]);
throw new Error(`Unable to find mvn in your path. ${ extra }`);
}
await rm("target");
return spawn("mvn", [ "site" ]);
});

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/// <reference path="../node_modules/zarro/types.d.ts" />
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -16,22 +17,22 @@
// under the License.

const
gulp = requireModule("gulp");
gulp = requireModule<Gulp>("gulp");

gulp.task("update-version-info", async () => {
// the version as per the .csproj is the correct version, but there
// are other places where the version string is set via [assembly]
// attributes, so we need to re-align them all
const
Git = require("simple-git/promise"),
readTextFile = requireModule("read-text-file"),
writeTextFile = requireModule("write-text-file"),
readCsProjVersion = requireModule("read-csproj-version"),
currentVersion = await readCsProjVersion("src/log4net/log4net.csproj"),
Git = require("simple-git"),
{ readTextFile, writeTextFile } = require("yafs"),
{ readProjectVersion } = requireModule<CsProjUtils>("csproj-utils"),
currentVersion = await readProjectVersion("src/log4net/log4net.csproj"),
assemblyInfo = "src/log4net/AssemblyInfo.cs",
assemblyVersionInfo = "src/log4net/AssemblyVersionInfo.cs",
versionString = sanitiseVersion(currentVersion);


await updateVersionsIn(assemblyInfo, versionString);
await updateVersionsIn(assemblyVersionInfo, versionString);

Expand All @@ -43,9 +44,9 @@ gulp.task("update-version-info", async () => {
await git.commit(`:bookmark: update versioning to ${versionString}`);

async function updateVersionsIn(
filePath,
newVersion
) {
filePath: string,
newVersion: string
): Promise<void> {
const
contents = await readTextFile(filePath),
updated = contents
Expand All @@ -56,7 +57,7 @@ gulp.task("update-version-info", async () => {
await writeTextFile(filePath, updated);
}

function sanitiseVersion(version) {
function sanitiseVersion(version: string): string {
const parts = version.split(".");
while (parts.length < 4) {
parts.push("0");
Expand Down
2 changes: 1 addition & 1 deletion log4net.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
<property name="log4net.basedir" value="." />
<property name="project.build.config" value="debug" />
<property name="project.build.package" value="false" />
<property name="package.version" value="2.0.15"/>
<property name="package.version" value="2.0.16"/>

<!-- Include log4net helpers -->
<include buildfile="${log4net.basedir}/log4net.include" />
Expand Down
2 changes: 1 addition & 1 deletion log4net.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ limitations under the License.
<!-- SHFB properties -->
<FrameworkVersion>.NET Framework 3.5</FrameworkVersion>
<OutputPath>doc\sdk\net\4.0\</OutputPath>
<HtmlHelpName>log4net-sdk-2.0.15</HtmlHelpName>
<HtmlHelpName>log4net-sdk-2.0.16</HtmlHelpName>
<Language>en-US</Language>
<SyntaxFilters>Standard</SyntaxFilters>
<SdkLinkTarget>Blank</SdkLinkTarget>
Expand Down
50 changes: 35 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
"prepare-build-artifacts": "zarro @",
"dump-env": "node -e \"console.log(process.env);\"",
"release": "run-s update-version-info build-release prepare-build-artifacts build-site",
"release-beta": "cross-env DOTNET_CORE=1 VERSION_INCREMENT_STRATEGY=prerelease BUILD_CONFIGURATION=Release zarro release-nuget",
"zarro": "zarro",
"update-version-info": "zarro @"
"update-version-info": "zarro @",
"this-is-an-example": "zarro @"
},
"repository": {
"type": "git",
Expand All @@ -36,9 +38,10 @@
"gulp-zip": "^5.0.2",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"simple-git": "^3.16.0",
"simple-git": "^3.22.0",
"typescript": "^5.3.3",
"which": "^2.0.2",
"yafs": "^1.5.0",
"zarro": "^1.169.0"
"yafs": "^1.36.0",
"zarro": "^1.170.0"
}
}
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!--
}
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
Expand All @@ -20,7 +21,7 @@
<groupId>log4net</groupId>
<artifactId>apache-log4net</artifactId>
<packaging>pom</packaging>
<version>2.0.15</version>
<version>2.0.16</version>
<name>Apache log4net</name>
<description>Logging framework for Microsoft .NET Framework.</description>
<url>http://logging.apache.org/log4net/</url>
Expand Down
Loading