You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by da...@apache.org on 2021/10/28 07:34:32 UTC
[logging-log4net] 01/01: :package: build zip artifacts with
containing folder
This is an automated email from the ASF dual-hosted git repository.
davydm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git
commit 9d039a84e2bc6308771136e9530e7eba94083db6
Author: Davyd McColl <da...@gmail.com>
AuthorDate: Thu Oct 28 09:30:57 2021 +0200
:package: build zip artifacts with containing folder
---
local-tasks/zip.js | 25 +++++++++++++++++++------
package-lock.json | 6 ++++++
package.json | 2 ++
3 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/local-tasks/zip.js b/local-tasks/zip.js
index cbfce84..1225a21 100644
--- a/local-tasks/zip.js
+++ b/local-tasks/zip.js
@@ -3,21 +3,31 @@ const
promisify = requireModule("promisify-stream"),
readCsProjVersion = requireModule("read-csproj-version"),
target = "build/artifacts",
+ debug = require("gulp-debug"),
+ rename = require("gulp-rename"),
zip = require("gulp-zip");
-gulp.task("zip", [ "zip-binaries", "zip-source"], () => Promise.resolve());
+gulp.task("zip", ["zip-binaries", "zip-source"], () => Promise.resolve());
gulp.task("zip-binaries", async () => {
- const version = await readVersion();
+ const
+ version = await readVersion(),
+ baseDir = `apache-log4net-binaries-${version}`;
return promisify(
gulp.src(["build/Release/**/*", "LICENSE", "NOTICE"])
- .pipe(zip(`log4net-binaries-${version}.zip`))
+ .pipe(rename(path => {
+ path.dirname = `${baseDir}/${path.dirname}`
+ }))
+ .pipe(zip(`${baseDir}.zip`))
.pipe(gulp.dest(target))
);
});
gulp.task("zip-source", async () => {
- const version = await readVersion();
+ const
+ version = await readVersion(),
+ baseDir = `apache-log4net-source-${version}`;
+
return promisify(
gulp.src([
"**/*",
@@ -32,8 +42,11 @@ gulp.task("zip-source", async () => {
"!.idea",
"!.idea/**/*"
])
- .pipe(zip(`log4net-source-${version}.zip`))
- .pipe(gulp.dest(target))
+ .pipe(rename(path => {
+ path.dirname = `${baseDir}/${path.dirname}`
+ }))
+ .pipe(zip(`${baseDir}.zip`))
+ .pipe(gulp.dest(target))
);
});
diff --git a/package-lock.json b/package-lock.json
index e02ddb9..0062e1c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2622,6 +2622,12 @@
}
}
},
+ "gulp-rename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-2.0.0.tgz",
+ "integrity": "sha512-97Vba4KBzbYmR5VBs9mWmK+HwIf5mj+/zioxfZhOKeXtx5ZjBk57KFlePf5nxq9QsTtFl0ejnHE3zTC9MHXqyQ==",
+ "dev": true
+ },
"gulp-zip": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/gulp-zip/-/gulp-zip-5.0.2.tgz",
diff --git a/package.json b/package.json
index b535be6..5523fe7 100644
--- a/package.json
+++ b/package.json
@@ -29,6 +29,8 @@
"homepage": "https://github.com/fluffynuts/logging-log4net#readme",
"devDependencies": {
"cross-env": "^7.0.2",
+ "gulp-debug": "^4.0.0",
+ "gulp-rename": "^2.0.0",
"gulp-zip": "^5.0.2",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",