Skip to content

Commit

Permalink
[#641] Separate dists into new repository (#648)
Browse files Browse the repository at this point in the history
Closes #641

- Output compiled files to `build\dist` folder
- Clone dist repo before compile for build control task
- Remove and ignore all compiled JS and build artifacts
- Update Grunt dependencies
  • Loading branch information
kamranayub committed Sep 8, 2016
1 parent bf7bd93 commit ce60f81
Show file tree
Hide file tree
Showing 73 changed files with 137 additions and 60,667 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
######################
/src/engine/*.js
/src/engine/*.map
/sandbox/src/*.js
/sandbox/web/**/*.js
/sandbox/web/excalibur.d.ts
/src/spec/*.js
node_modules/
/bower_components/
Expand Down
24 changes: 0 additions & 24 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ script:
- grunt travis
after_success:
- node deploy-docs.js
- if [ "$TRAVIS_BRANCH" = "master" ]; then grunt dists; fi
notifications:
slack:
secure: aQXFk2/MxX5eR2JM90xWAA9YX03QArY1ejUmnP/NkFHbB4zzKZblACjEeDTDTDCThZpXhrganX2nDWrWFrrXbOG28wKrRhEZSULPAgyiWGpfkMoT44fKmgh+eZ5C/isMF2eeQCrYo3EQCMxfCKxNaBhyLc+jr/Sm232zU2LaXo8=
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Added
- `ex.Promise.join(Promise[])` support (in addition to `...promises` support) (#642)
- Moved build artifacts to separate [excalibur-dist](https://github.com/excaliburjs/excalibur-dist) repository (#648)
- `ex.Events` namespace and typed event handler `.on(...)` overloads for default events on core excalibur objects (##639)

### Fixed
Expand Down
7 changes: 4 additions & 3 deletions Excalibur.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<description>Excalibur.js is a simple JavaScript game engine with TypeScript bindings for making 2D games in HTML5 Canvas. Our mission is to make web game development as simple as possible.</description>
</metadata>
<files>
<file src="dist\excalibur-*.js" target="content/Scripts" />
<file src="dist\excalibur-*.d.ts" target="content/Scripts" />
<file src="dist\excalibur-*.js.map" target="content/Scripts" />
<file src="build\dist\excalibur.d.ts" target="content\Scripts" />
<file src="build\dist\excalibur.js" target="content\Scripts" />
<file src="build\dist\excalibur.min.js" target="content\Scripts" />
<file src="build\dist\excalibur.min.js.map" target="content\Scripts" />
</files>
</package>
118 changes: 74 additions & 44 deletions GruntFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@ module.exports = function (grunt) {
istanbulCmd: path.join('node_modules', '.bin', 'istanbul'),
jasmineJs: path.join('node_modules', 'jasmine', 'bin', 'jasmine.js'),

//
// Clean dists
//
clean: ['build/dist'],

//
// Concatenate build files
// Add banner to files
//
concat: {
main: {
src: ['dist/<%= pkg.name %>-<%= version %>.js', 'src/engine/Exports.js'],
dest: 'dist/<%= pkg.name %>-<%= version %>.js'
src: ['build/dist/<%= pkg.name %>.js', 'src/engine/Exports.js'],
dest: 'build/dist/<%= pkg.name %>.js'
},
minified: {
src: ['dist/<%= pkg.name %>-<%= version %>.min.js', 'src/engine/Exports.js'],
dest: 'dist/<%= pkg.name %>-<%= version %>.min.js'
src: ['build/dist/<%= pkg.name %>.min.js', 'src/engine/Exports.js'],
dest: 'build/dist/<%= pkg.name %>.min.js'
},
options: {
separator: '\n;\n',
Expand All @@ -45,29 +50,15 @@ module.exports = function (grunt) {
//
// Minify files
//
minified: {
files: {
src: 'dist/<%= pkg.name %>-<%= version %>.js',
dest: 'dist/<%= pkg.name %>-<%= version %>'
},
uglify: {
options: {
sourcemap: false,
allinone: true,
dest_filename: '.min.js'
}
},

//
// Watch files
//
watch: {
scripts: {
files: ['src/engine/*.ts', 'src/engine/*/*.ts', 'src/spec/*.ts'],
tasks: ['tslint:src', 'shell:specs', 'jasmine_node'],
options: {
interrupt: true
}
}
sourceMap: true
},
main: {
files: {
'build/dist/<%= pkg.name %>.min.js': 'build/dist/<%= pkg.name %>.js'
}
}
},

//
Expand All @@ -79,22 +70,21 @@ module.exports = function (grunt) {
// Execute TypeScript compiler against Excalibur core
//
tsc: {
command: '<%= tscCmd %> --sourcemap --declaration --target ES5 "./src/engine/Engine.ts" --out "./dist/<%= pkg.name %>-<%= version %>.js"',
command: '<%= tscCmd %> --declaration --target ES5 "./src/engine/Engine.ts" --out "./build/dist/<%= pkg.name %>.js"',
options: {
stdout: true,
failOnError: true
}
},


},

//
// Package up Nuget (Windows only)
//
nuget: {
command: 'src\\tools\\nuget pack Excalibur.nuspec -version <%= version %> -OutputDirectory ./dist',
command: 'src\\tools\\nuget pack Excalibur.nuspec -version <%= version %> -OutputDirectory ./build/dist',
options: {
stdout: true
stdout: true,
failOnError: true
}
},

Expand Down Expand Up @@ -158,6 +148,14 @@ module.exports = function (grunt) {
stdout: true,
failOnError: true
}
},

gitBuild: {
command: 'git clone https://github.com/excaliburjs/excalibur-dist build',
options: {
stdout: true,
failOnError: true
}
}

},
Expand All @@ -168,14 +166,39 @@ module.exports = function (grunt) {
copy: {
main: {
files: [
{src: './dist/<%= pkg.name %>-<%= version %>.js', dest: './dist/<%= pkg.name %>.js'},
{src: './dist/<%= pkg.name %>-<%= version %>.js', dest: './sandbox/web/<%= pkg.name %>.js'},
{src: './dist/<%= pkg.name %>-<%= version %>.min.js', dest: './dist/<%= pkg.name %>.min.js'},
{src: './dist/<%= pkg.name %>-<%= version %>.d.ts', dest: './dist/<%= pkg.name %>.d.ts'}
{src: './build/dist/<%= pkg.name %>.js', dest: './sandbox/web/<%= pkg.name %>.js'},
{src: './build/dist/<%= pkg.name %>.d.ts', dest: './sandbox/web/<%= pkg.name %>.d.ts'}
]
}
},

//
// Dist build control
//
buildcontrol: {
options: {
dir: 'build',
commit: true,
push: true,
message: ':shipit: Built excaliburjs/Excalibur@%sourceCommit% on branch %sourceBranch%',
config: {
'user.name': 'Travis-CI',
'user.email': 'travis@excaliburjs.com'
}
},

// continuous integration dists
dist: {
options: {
branch: 'master',
remote: 'https://github.com/excaliburjs/excalibur-dist',
login: 'kamranayub',
token: process.env.GH_DIST_TOKEN,
fetchProgress: false
}
}
},

//
// TS Lint configuration
//
Expand Down Expand Up @@ -210,34 +233,41 @@ module.exports = function (grunt) {
// Load NPM Grunt tasks as dependencies
//
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-minified');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-tslint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-build-control');

//
// Register available Grunt tasks
//

// Compile core engine
grunt.registerTask('compile', ['shell:gitBuild', 'clean', 'shell:tsc', 'uglify', 'concat', 'copy']);

// Run tests quickly
grunt.registerTask('tests', ['shell:specs', 'shell:tests']);

// Compile sample game
grunt.registerTask('sample', ['shell:sample']);

// Compile visual tests
grunt.registerTask('visual', ['shell:visual']);

grunt.registerTask('compile', ['shell:tsc', 'minified', 'concat', 'copy', 'shell:nuget'])

grunt.registerTask('server', [])
grunt.registerTask('visual', ['shell:visual']);

// Travis task - for Travis CI
// Travis CI task
grunt.registerTask('travis', 'default');

// Appveyor task
grunt.registerTask('appveyor', ['default', 'shell:nuget']);

// CI task to deploy dists
grunt.registerTask('dists', ['buildcontrol']);

// Default task - compile, test, build dists
grunt.registerTask('default', ['tslint:src', 'shell:specs', 'shell:istanbul', 'coveralls', 'shell:tsc', 'minified', 'concat', 'copy', 'sample', 'visual', 'shell:nuget']);
grunt.registerTask('default', ['tslint:src', 'shell:specs', 'shell:istanbul', 'coveralls', 'compile', 'sample', 'visual']);

};
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ install:
- npm install grunt-cli -g
- npm install
build_script:
- grunt travis
- grunt appveyor
artifacts:
- path: dist\Excalibur.%APPVEYOR_BUILD_VERSION%.nupkg
- path: build\dist\Excalibur.%APPVEYOR_BUILD_VERSION%.nupkg
name: Nuget Package
after_build:
- appveyor PushArtifact dist\Excalibur.%APPVEYOR_BUILD_VERSION%.nupkg
- appveyor PushArtifact build\dist\Excalibur.%APPVEYOR_BUILD_VERSION%.nupkg
#build: off
matrix:
fast_finish: true
Expand Down
42 changes: 0 additions & 42 deletions bower.json

This file was deleted.

Binary file removed dist/Excalibur.0.7.0.nupkg
Binary file not shown.
Loading

0 comments on commit ce60f81

Please sign in to comment.