Skip to content

Commit

Permalink
Merge pull request #129 from hmrc/PLATUI-1057_publish-license
Browse files Browse the repository at this point in the history
PLATUI-1057: Adding LICENSE to build with tests
  • Loading branch information
JoPintoPaul authored Mar 19, 2021
2 parents 6d47936 + 8d0c62a commit 28eedcd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [1.28.0] - 2021-03-19

## Fixed

- Package was missing LICENSE

## [1.27.0] - 2021-03-04

## Added
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gulp.task('build:package', gulp.series(
'js:compile-all-govuk-and-hmrc',
'update-assets-version',
'copy:README',
'copy:LICENSE',
'copy:packageJson',
));

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hmrc-frontend",
"version": "1.27.0",
"version": "1.28.0",
"description": "Design patterns for HMRC frontends",
"scripts": {
"start": "gulp dev",
Expand Down
11 changes: 11 additions & 0 deletions tasks/gulp/__tests__/after-build-package.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('package/', () => {
'govuk-prototype-kit.config.json',
'package.json',
'README.md',
'LICENSE',
'hmrc/govuk/fonts/bold-affa96571d-v2.woff',
'hmrc/govuk/fonts/bold-b542beb274-v2.woff2',
'hmrc/govuk/fonts/light-94a07e06a1-v2.woff2',
Expand Down Expand Up @@ -104,6 +105,16 @@ describe('package/', () => {
}));
});

describe('LICENSE', () => {
it('is added', () => readFile(path.join(configPaths.package, 'LICENSE'), 'utf8')
.then((contents) => {
// Look for H1 matching 'GOV.UK Frontend' from existing README
expect(contents).toMatch(/^ {33}Apache License/);
}).catch((error) => {
throw error;
}));
});

describe('all.scss', () => {
const govukLink = path.join(configPaths.packageTest, 'govuk-frontend');
const hmrcLink = path.join(configPaths.packageTest, 'hmrc-frontend');
Expand Down
5 changes: 5 additions & 0 deletions tasks/gulp/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ gulp.task('copy:README', () => gulp
.src(`${configPaths.src}../README.md`)
.pipe(gulp.dest(configPaths.package)));

gulp.task('copy:LICENSE', () => gulp
.src(`${configPaths.src}../LICENSE`)
.pipe(gulp.dest(configPaths.package)));

gulp.task('copy:packageJson', (done) => {
const requiredKeys = [
'name',
Expand All @@ -28,6 +32,7 @@ gulp.task('copy:packageJson', (done) => {
'homepage',
'dependencies',
'scripts',
'license',
];

Object.keys(packageFile).forEach((key) => {
Expand Down

0 comments on commit 28eedcd

Please sign in to comment.