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

build: publish material-examples package #4064

Merged
merged 2 commits into from
Apr 13, 2017
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
20 changes: 10 additions & 10 deletions scripts/release/publish-docs-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
cd "$(dirname $0)/../../"

docsPath="./dist/docs"
packagePath="./dist/releases/material-examples"
repoPath="/tmp/material2-docs-content"
repoUrl="https://github.com/angular/material2-docs-content"
examplesSource="./dist/docs/examples"

# If the docs directory is not present, generate docs
if [ ! -d $docsPath ]; then
$(npm bin)/gulp docs
fi
$(npm bin)/gulp examples:release
$(npm bin)/gulp docs

# Get git meta info for commit
commitSha="$(git rev-parse --short HEAD)"
Expand All @@ -28,15 +27,16 @@ git clone $repoUrl $repoPath

# Clean out repo directory and copy contents of dist/docs into it
rm -rf $repoPath/*
mkdir $repoPath/overview
mkdir $repoPath/guides
mkdir $repoPath/api
mkdir $repoPath/examples
mkdir $repoPath/plunker

# Create folders that will contain docs content files.
mkdir $repoPath/{overview,guides,api,examples,plunker,examples-package}

# Copy api files over to $repoPath/api
cp -r $docsPath/api/* $repoPath/api

# Copy the material-examples package to the docs content repository.
cp -r $packagePath/* $repoPath/examples-package

# Flatten the markdown docs structure and move it into $repoPath/overview
overviewFiles=$docsPath/markdown/
for filename in $overviewFiles*
Expand Down Expand Up @@ -65,7 +65,7 @@ done
cp -r $examplesSource/* $repoPath/examples

# Copy example plunker assets
rsync -a $docsPath/plunker $repoPath/plunker
cp -r $docsPath/plunker/* $repoPath/plunker

# Copies assets over to the docs-content repository.
cp LICENSE $repoPath/
Expand Down
4 changes: 2 additions & 2 deletions tools/gulp/tasks/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ task('highlight-examples', () => {
path.basename = `${path.basename}-${extension}`;
};

return src('src/examples/**/*.+(html|css|ts)')
return src('src/material-examples/**/*.+(html|css|ts)')
.pipe(flatten())
.pipe(rename(renameFile))
.pipe(highlight())
Expand All @@ -111,7 +111,7 @@ task('minified-api-docs', ['api-docs'], () => {

/** Copies example sources to be used as plunker assets for the docs site. */
task('plunker-example-assets', () => {
src(path.join(SOURCE_ROOT, 'examples', '**/*'))
src(path.join(SOURCE_ROOT, 'material-examples', '**/*'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're in here, can you remove the extra plunker/ that's being written to the docs content?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.pipe(dest(path.join(DIST_DOCS, 'plunker', 'examples')));
});

Expand Down