Skip to content

Commit

Permalink
build: expose version object in releases (#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored and vthinkxie committed Aug 3, 2018
1 parent 8e7a6cb commit 92d85f3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ rm -rf publish-es2015
cp -r components __gen_components
node ./build_scripts/inline-template.js

VERSION=$(node -p "require('./package.json').version")

echo "Package Version: ${VERSION}"
perl -p -i -e "s/0\.0\.0\-PLACEHOLDER/${VERSION}/g" $(grep -ril 0\.0\.0\-PLACEHOLDER __gen_components) < /dev/null 2> /dev/null

echo 'Compiling to es2015 via Angular compiler'
$(npm bin)/ngc -p tsconfig-build.json -t es2015 --outDir publish-es2015/src

Expand Down
1 change: 1 addition & 0 deletions components/ng-zorro-antd.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export * from './cascader';
export * from './tree';
export * from './tree-select';
export * from './time-picker';
export * from './version';

@NgModule({
exports: [
Expand Down
3 changes: 3 additions & 0 deletions components/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Version } from '@angular/core';

export const VERSION = new Version('0.0.0-PLACEHOLDER');

0 comments on commit 92d85f3

Please sign in to comment.