forked from emberjs/data
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use rakep to build ember-data and phantomejs for tests
- Loading branch information
Showing
16 changed files
with
444 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ dist/ | |
|
||
.DS_Store | ||
.project | ||
|
||
tests/ember-data-tests.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,92 @@ | ||
require "rake-pipeline-web-filters" | ||
require "json" | ||
require "uglifier" | ||
require "./neuter" | ||
|
||
output "tests/source" | ||
class EmberProductionFilter < Rake::Pipeline::Filter | ||
def generate_output(inputs, output) | ||
inputs.each do |input| | ||
result = File.read(input.fullpath) | ||
result.gsub!(%r{^(\s)+ember_(assert|deprecate|warn)\((.*)\).*$}, "") | ||
output.write result | ||
end | ||
end | ||
end | ||
|
||
class EmberLicenseFilter < Rake::Pipeline::Filter | ||
def generate_output(inputs, output) | ||
inputs.each do |input| | ||
file = File.read(input.fullpath) | ||
license = File.read("generators/license.js") | ||
output.write "#{license}\n\n#{file}" | ||
end | ||
end | ||
end | ||
|
||
distros = { | ||
:full => %w(ember-data) | ||
} | ||
|
||
output "dist" | ||
|
||
input "packages" do | ||
match "*/{lib,tests}/**/*.js" do | ||
output "tests" | ||
|
||
match "*/tests/**/*.js" do | ||
minispade :rewrite_requires => true, :string => true, :module_id_generator => proc { |input| | ||
id = input.path.dup | ||
id.sub!('/lib/', '/') | ||
id.sub!(/\.js$/, '') | ||
id.sub!(/\/main$/, '') | ||
id.sub!('/tests', '/~tests') | ||
id | ||
} | ||
|
||
concat do |filename| | ||
filename =~ %r{/tests/} ? "ember-tests.js" : "ember.js" | ||
end | ||
concat "ember-data-tests.js" | ||
end | ||
end | ||
|
||
# Hack to ignore certain files | ||
match "**/*.{json,md}" do | ||
concat "trash" | ||
end | ||
input "packages" do | ||
match "*/lib/**/*.js" do | ||
minispade :rewrite_requires => true, :string => true, :module_id_generator => proc { |input| | ||
id = input.path.dup | ||
id.sub!('/lib/', '/') | ||
id.sub!(/\.js$/, '') | ||
id.sub!(/\/main$/, '') | ||
id | ||
} | ||
|
||
match "**/README" do | ||
concat "trash" | ||
concat "ember-data-spade.js" | ||
end | ||
end | ||
|
||
match "*/*.js" do | ||
concat "trash" | ||
input "packages" do | ||
match "*/lib/**/main.js" do | ||
neuter do |filename| | ||
File.join("modules/", filename.gsub('/lib/main.js', '.js')) | ||
end | ||
end | ||
end | ||
|
||
distros.each do |name, modules| | ||
name = "ember-data" | ||
|
||
input "dist/modules" do | ||
module_paths = modules.map{|m| "#{m}.js" } | ||
match "{#{module_paths.join(',')}}" do | ||
concat(module_paths){ ["#{name}.js", "#{name}.prod.js"] } | ||
end | ||
|
||
# Strip dev code | ||
match "#{name}.prod.js" do | ||
filter(EmberProductionFilter) { ["#{name}.prod.js", "#{name}.min.js"] } | ||
end | ||
|
||
# Minify | ||
match "#{name}.min.js" do | ||
uglify{ "#{name}.min.js" } | ||
filter EmberLicenseFilter | ||
end | ||
end | ||
end | ||
|
||
# vim: filetype=ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
source "http://rubygems.org" | ||
|
||
gem "sproutcore", :git => "https://github.com/wycats/abbot-from-scratch.git" | ||
gem "uglifier", "~> 1.0.3" | ||
gem "execjs", "~> 1.2.6" | ||
gem "rack" | ||
gem "rake-pipeline", :git => "https://github.com/livingsocial/rake-pipeline.git" | ||
gem "rake-pipeline-web-filters", :git => "https://github.com/wycats/rake-pipeline-web-filters.git" | ||
gem "github-upload" | ||
gem "colored" | ||
gem "uglifier", "~> 1.0.3" | ||
|
||
group :development do | ||
gem "rack" | ||
gem "github-upload" | ||
gem "ember-docs", :git => "https://github.com/wagenet/ember-docs.git" | ||
gem "kicker" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.