Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed build setting directories parameter to files

  • Loading branch information...
commit 9f472c0170582551c3f48f8f57a7a6332231d38d 1 parent f130c61
Peter Wagenet wagenet authored
3  lib/bpm/package.rb
View
@@ -148,7 +148,8 @@ def directory_files
dir_names.reject! { |t| t == tests_path }
build_names = bpm_build.values.map do |hash|
- hash['directories'] || hash['assets']
+ # Directories is deprecated
+ hash['files'] || hash['directories'] || hash['assets']
end
build_names += PLUGIN_TYPES.map do |type|
1  lib/bpm/pipeline.rb
View
@@ -112,7 +112,6 @@ def magic_paths
# Returns an array of all the buildable assets in the current directory.
# These are the assets that will be built when you compile the project.
def buildable_assets
-
# make sure the logical_path can be used to simply build into the
# assets directory when we are done
ret = project.buildable_asset_filenames mode
46 lib/bpm/project.rb
View
@@ -135,33 +135,34 @@ def preview_root(*paths)
end
def build_app?
- !!(bpm_build && bpm_build["bpm_libs.js"] &&
- bpm_build["bpm_libs.js"]["directories"] &&
- bpm_build["bpm_libs.js"]["directories"].size>0)
+ # Make sure we have some lib files
+ !!(bpm_build &&
+ bpm_build["bpm_libs.js"] &&
+ ((bpm_build["bpm_libs.js"]["files"] && bpm_build["bpm_libs.js"]["files"].size>0) ||
+ (bpm_build["bpm_libs.js"]["directories"] && bpm_build["bpm_libs.js"]["directories"].size>0)))
end
def build_app=(value)
-
bpm_libs = "bpm_libs.js"
bpm_styles = "bpm_styles.css"
if value
bpm_build[bpm_libs] ||= {}
hash = bpm_build[bpm_libs]
- hash['directories'] ||= []
- hash['directories'] << 'lib' if hash['directories'].size==0
+ hash['files'] ||= hash['directories'] || []
+ hash['files'] << 'lib' if hash['files'].size==0
hash['minifier'] ||= 'uglify-js'
bpm_build[bpm_styles] ||= {}
hash = bpm_build[bpm_styles]
- hash['directories'] ||= []
- hash['directories'] << 'css' if hash['directories'].size==0
+ hash['files'] ||= hash['directories'] || []
+ hash['files'] << 'css' if hash['files'].size==0
directories ||= {}
- directories['lib'] ||= ['app']
+ directories['lib'] ||= ['lib']
else
- bpm_build[bpm_libs]['directories'] = []
- bpm_build[bpm_styles]['directories'] = []
+ bpm_build[bpm_libs]['files'] = []
+ bpm_build[bpm_styles]['files'] = []
end
value
end
@@ -761,7 +762,6 @@ def has_mode(opts, mode)
## BUILD OPTIONS
def merge_build_opts(ret, dep_name, target_name, opts, mode)
-
ret[target_name] ||= {}
if opts['assets']
@@ -769,8 +769,14 @@ def merge_build_opts(ret, dep_name, target_name, opts, mode)
return
end
- if opts['directories'] && opts['directories'].size>0
- ret[target_name][dep_name] = opts['directories']
+ if opts['directories']
+ warn "[DEPRECATION] Use 'files' array instead of 'directories' array in #{dep_name} config"
+ opts['files'] ||= []
+ opts['files'] += opts.delete('directories')
+ end
+
+ if opts['files'] && opts['files'].size>0
+ ret[target_name][dep_name] = opts['files']
end
if opts['minifier']
@@ -807,13 +813,13 @@ def project_settings_excludes(dep_name, target_name)
DEFAULT_BUILD_OPTS = {
'bpm_libs.js' => {
- 'directories' => ['lib'],
- 'modes' => ['*']
+ 'files' => ['lib'],
+ 'modes' => ['*']
},
'bpm_styles.css' => {
- 'directories' => ['css'],
- 'modes' => ['*']
+ 'files' => ['css'],
+ 'modes' => ['*']
}
}
@@ -840,8 +846,8 @@ def default_build_opts(dep_name)
}
ret["#{dep_name}/bpm_tests.js"] = {
- 'directories' => ['tests'],
- 'modes' => ['debug']
+ 'files' => ['tests'],
+ 'modes' => ['debug']
}
@default_build_opts[dep_name] = ret
BIN  spec/fixtures/gems/core-test-0.4.9.bpkg
View
Binary file not shown
2  spec/fixtures/packages/core-test/package.json
View
@@ -39,7 +39,7 @@
"bpm:build": {
"bpm_styles.css": {
- "directories": ["resources"]
+ "files": ["resources"]
},
"core-test": {
2  spec/fixtures/projects/coffee/coffee.json
View
@@ -10,7 +10,7 @@
"bpm:build": {
"bpm_libs.js": {
- "directories": ["lib", "templates"]
+ "files": ["lib", "templates"]
}
}
}
6 spec/fixtures/projects/hello_world/hello_world.json
View
@@ -26,15 +26,15 @@
"bpm:build": {
"hello_world/bpm_libs.js": {
- "directories": ["lib", "custom"]
+ "files": ["lib", "custom"]
},
"hello_world/bpm_styles.css": {
- "directories": ["css"]
+ "files": ["css"]
},
"hello_world/bpm_tests.js": {
- "directories": ["test"]
+ "files": ["test"]
}
}
2  spec/fixtures/projects/hello_world/vendor/custom_package/package.json
View
@@ -18,7 +18,7 @@
"bpm:build": {
"bpm_libs.js": {
- "directories": ["lib", "not-normal"],
+ "files": ["lib", "not-normal"],
"minifier": "uglify-js"
}
}
6 spec/fixtures/projects/init_app/new_project.json
View
@@ -4,15 +4,15 @@
"bpm:build": {
"bpm_libs.js": {
- "directories": [
+ "files": [
"lib"
],
"minifier": "uglify-js"
},
"bpm_styles.css": {
- "directories": [
+ "files": [
"css"
]
}
}
-}
+}
4 spec/fixtures/projects/init_default/new_project.json
View
@@ -4,12 +4,12 @@
"bpm:build": {
"bpm_libs.js": {
- "directories": [],
+ "files": [],
"minifier": "uglify-js"
},
"bpm_styles.css": {
- "directories": []
+ "files": []
}
}
}
2  spec/fixtures/projects/minitest/minitest.json
View
@@ -19,7 +19,7 @@
},
"minitest/bpm_libs.js": {
- "directories": ["lib"],
+ "files": ["lib"],
"minifier": { "uglyduck": ">= 0" },
"uglyduck:where": "sanfran"
}
2  spec/fixtures/projects/minitrans/minitrans.json
View
@@ -17,7 +17,7 @@
"bpm:build": {
"bpm_libs.js": {
- "directories": ["lib"],
+ "files": ["lib"],
"minifier": "uglyduck"
}
}
2  spec/spec_helper.rb
View
@@ -25,7 +25,7 @@ def reset_host
# Use to avoid throwing errors just because an extra newline shows up
# somewhere
def normalize_whitespace(string)
- string.gsub(/ +/, ' ').gsub(/\n+/,"\n")
+ string.gsub(/ +/, ' ').gsub(/\n+/,"\n").strip
end
def compare_file_contents(actual_path, expected_path)
5 templates/init/project.json
View
@@ -4,13 +4,12 @@
"bpm:build": {
"bpm_libs.js": {
- "directories": [],
+ "files": [],
"minifier": "uglify-js"
},
"bpm_styles.css": {
- "directories": []
+ "files": []
}
}
}
-
Please sign in to comment.
Something went wrong with that request. Please try again.