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

Bundle the license-file for the Liberation fonts in the builds (PR 13517 follow-up) #13529

Merged
merged 2 commits into from
Jun 10, 2021
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
File renamed without changes.
106 changes: 38 additions & 68 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,26 @@ function createImageDecodersBundle(defines) {
.pipe(replaceJSRootName(imageDecodersAMDName, "pdfjsImageDecoders"));
}

function createCMapBundle() {
return gulp.src(["external/bcmaps/*.bcmap", "external/bcmaps/LICENSE"], {
base: "external/bcmaps",
});
}

function createStandardFontBundle() {
return gulp.src(
[
"external/standard_fonts/*.pfb",
"external/standard_fonts/*.ttf",
"external/standard_fonts/LICENSE_FOXIT",
"external/standard_fonts/LICENSE_LIBERATION",
],
{
base: "external/standard_fonts",
}
);
}

function checkFile(filePath) {
try {
const stat = fs.lstatSync(filePath);
Expand Down Expand Up @@ -807,23 +827,9 @@ function buildGeneric(defines, dir) {
base: "web/",
})
.pipe(gulp.dest(dir + "web")),
gulp
.src(["external/bcmaps/*.bcmap", "external/bcmaps/LICENSE"], {
base: "external/bcmaps",
})
.pipe(gulp.dest(dir + "web/cmaps")),
gulp
.src(
[
"external/standard_fonts/*.pfb",
"external/standard_fonts/*.ttf",
"external/standard_fonts/LICENSE",
],
{
base: "external/standard_fonts",
}
)
.pipe(gulp.dest(dir + "web/standard_fonts")),
createCMapBundle().pipe(gulp.dest(dir + "web/cmaps")),
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),

preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
preprocessCSS("web/viewer.css", "generic", defines, true)
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
Expand Down Expand Up @@ -987,23 +993,8 @@ function buildMinified(defines, dir) {
base: "web/",
})
.pipe(gulp.dest(dir + "web")),
gulp
.src(["external/bcmaps/*.bcmap", "external/bcmaps/LICENSE"], {
base: "external/bcmaps",
})
.pipe(gulp.dest(dir + "web/cmaps")),
gulp
.src(
[
"external/standard_fonts/*.pfb",
"external/standard_fonts/*.ttf",
"external/standard_fonts/LICENSE",
],
{
base: "external/standard_fonts",
}
)
.pipe(gulp.dest(dir + "web/standard_fonts")),
createCMapBundle().pipe(gulp.dest(dir + "web/cmaps")),
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),

preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
preprocessCSS("web/viewer.css", "minified", defines, true)
Expand Down Expand Up @@ -1233,23 +1224,13 @@ gulp.task(
gulp
.src(MOZCENTRAL_COMMON_WEB_FILES, { base: "web/" })
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),
gulp
.src(["external/bcmaps/*.bcmap", "external/bcmaps/LICENSE"], {
base: "external/bcmaps",
})
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/cmaps")),
gulp
.src(
[
"external/standard_fonts/*.pfb",
"external/standard_fonts/*.ttf",
"external/standard_fonts/LICENSE",
],
{
base: "external/standard_fonts",
}
)
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/standard_fonts")),
createCMapBundle().pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/cmaps")
),
createStandardFontBundle().pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/standard_fonts")
),

preprocessHTML("web/viewer.html", defines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
),
Expand Down Expand Up @@ -1335,23 +1316,12 @@ gulp.task(
{ base: "web/" }
)
.pipe(gulp.dest(CHROME_BUILD_CONTENT_DIR + "web")),
gulp
.src(["external/bcmaps/*.bcmap", "external/bcmaps/LICENSE"], {
base: "external/bcmaps",
})
.pipe(gulp.dest(CHROME_BUILD_CONTENT_DIR + "web/cmaps")),
gulp
.src(
[
"external/standard_fonts/*.pfb",
"external/standard_fonts/*.ttf",
"external/standard_fonts/LICENSE",
],
{
base: "external/standard_fonts",
}
)
.pipe(gulp.dest(CHROME_BUILD_CONTENT_DIR + "web/standard_fonts")),
createCMapBundle().pipe(
gulp.dest(CHROME_BUILD_CONTENT_DIR + "web/cmaps")
),
createStandardFontBundle().pipe(
gulp.dest(CHROME_BUILD_CONTENT_DIR + "web/standard_fonts")
),

preprocessHTML("web/viewer.html", defines).pipe(
gulp.dest(CHROME_BUILD_CONTENT_DIR + "web")
Expand Down