From e9092007ee54af3dec94711b05cfa4574be1015c Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Sun, 27 Sep 2009 21:13:50 -0700 Subject: [PATCH] Added support for new FileList. Reviewed by me. --- AppKit/Jakefile | 14 ++++++-------- AppKit/Tools/blend/Jakefile | 4 ++-- Foundation/Jakefile | 4 ++-- .../lib-js/objective-j/jake/bundletask.js | 2 +- common.jake | 3 ++- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/AppKit/Jakefile b/AppKit/Jakefile index 0c14ab64e..56080225c 100644 --- a/AppKit/Jakefile +++ b/AppKit/Jakefile @@ -9,9 +9,7 @@ $ENVIRONMENT_PRODUCT = FILE.join($ENVIRONMENT_FRAMEWORKS_DIR, 'AppKit'); $THEME_PRODUCT = FILE.join($BUILD_PATH, 'Resources', 'Aristo.blend'); $ENVIRONMENT_THEME_PRODUCT = FILE.join($ENVIRONMENT_PRODUCT, 'Resources', 'Aristo.blend'); -//AppKitFiles = FileList['**/*.j'].exclude('CoreGraphics/CGContextCanvas.j', 'CoreGraphics/CGContextVML.j', 'Themes/**', 'Tools/**') - -AppKitFiles = FILE.glob("*.j").concat(FILE.glob("Cib/*.j")).concat(FILE.glob("CoreAnimation/*.j")).concat(FILE.glob("CPWindow/*.j")).concat(FILE.glob("Platform/**/*.j")).concat(FILE.glob("Platform/*.j")).concat(FILE.glob("CoreGraphics/*.j")); +AppKitFiles = new FileList("**/*.j").exclude('CoreGraphics/CGContextCanvas.j', 'CoreGraphics/CGContextVML.j', 'Themes/**/*', 'Tools/**/*'); appKitTask = framework ("AppKit", function(appKitTask) { @@ -24,7 +22,7 @@ appKitTask = framework ("AppKit", function(appKitTask) appKitTask.setIdentifier("com.280n.AppKit"); appKitTask.setLicense(BundleTask.License.LGPL_v2_1); appKitTask.setSources(AppKitFiles);//terrible! - appKitTask.setResources(FILE.glob("Resources/*")); + appKitTask.setResources(new FileList("Resources/**/*")); appKitTask.setPlatforms([BundleTask.Platform.Browser, BundleTask.Platform.CommonJS]); appKitTask.setFlattensSources(true); @@ -53,17 +51,17 @@ filedir ($COMMONJS_PRODUCT_APPKIT, ["AppKit"], function() // cp_r(File.join($THEME_PRODUCT, '.'), $ENVIRONMENT_THEME_PRODUCT) //end +subtasks (["Tools"], ["build"/*, "clean", "clobber"*/]); + $THEME_PRODUCT = FILE.join(appKitTask.buildProductPath(), "Resources", "Aristo.blend"); -ThemeFiles = FILE.glob("Themes/Aristo/*");//FileList['Themes/Aristo/*'] +ThemeFiles = new FileList("Themes/Aristo/*"); filedir ($THEME_PRODUCT, ThemeFiles, function() { - OS.system("PATH=$PATH:" + OS.enquote(FILE.join($BUILD_DIR, $CONFIGURATION, "CommonJS", "objective-j", "bin")) + " blend -d Themes/Aristo/ThemeDescriptors.j -o " + $THEME_PRODUCT + " -R Themes/Aristo/Resources"); + OS.system("PATH=" + OS.enquote(FILE.join($BUILD_DIR, $CONFIGURATION, "CommonJS", "objective-j", "bin")) + ":$PATH blend -d Themes/Aristo/ThemeDescriptors.j -o " + $THEME_PRODUCT + " -R Themes/Aristo/Resources"); // rake abort if ($? != 0) }); task ("build", ["AppKit", $COMMONJS_PRODUCT_APPKIT, $THEME_PRODUCT]); -subtasks (["Tools"], ["build"/*, "clean", "clobber"*/]); - //CLOBBER.include($ENVIRONMENT_PRODUCT) diff --git a/AppKit/Tools/blend/Jakefile b/AppKit/Tools/blend/Jakefile index 93c729b36..0062c5256 100644 --- a/AppKit/Tools/blend/Jakefile +++ b/AppKit/Tools/blend/Jakefile @@ -13,8 +13,8 @@ app ("blend", function(blendTask) blendTask.setSummary("blend classes for Cappuccino"); blendTask.setIdentifier("blend"); blendTask.setVersion("0.7.1"); - blendTask.setSources(FILE.glob("*.j"));// = FileList['**/*.j'] - blendTask.setResources(FILE.glob("Resources/*"));// t.resources = FileList['Resources/*'] + blendTask.setSources(new FileList("**/*.j")); + blendTask.setResources(new FileList("Resources/**/*")); blendTask.setLicense(BundleTask.License.LGPL_v2_1); blendTask.setFlattensSources(true); diff --git a/Foundation/Jakefile b/Foundation/Jakefile index 9bcc78748..259ec7965 100644 --- a/Foundation/Jakefile +++ b/Foundation/Jakefile @@ -13,8 +13,8 @@ foundationTask = framework ("Foundation", function(foundationTask) foundationTask.setSummary("Foundation classes for Cappuccino"); foundationTask.setIdentifier("com.280n.Foundation"); foundationTask.setLicense(BundleTask.License.LGPL_v2_1); - foundationTask.setSources(FILE.glob("**/*.j"));//terrible! - foundationTask.setResources(FILE.glob("Resources/*")); + foundationTask.setSources(new FileList("**/*.j"));//terrible! + foundationTask.setResources(new FileList("Resources/**/*")); foundationTask.setFlattensSources(true); if ($CONFIGURATION === "Release") diff --git a/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js b/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js index 494591da3..dee6669b2 100644 --- a/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js +++ b/Objective-J/CommonJS/objective-j/lib-js/objective-j/jake/bundletask.js @@ -477,7 +477,7 @@ BundleTask.prototype.defineSourceTasks = function() staticPath = this.buildProductStaticPathForPlatform(aPlatform), flags = BundleTask.PLATFORM_DEFAULT_FLAGS[aPlatform].join(" "); - if (!Array.isArray(platformSources)) + if (!Array.isArray(platformSources) && platformSources.constructor !== Jake.FileList) platformSources = platformSources[aPlatform]; var replacedFiles = []; diff --git a/common.jake b/common.jake index bb54534a3..e0834d990 100644 --- a/common.jake +++ b/common.jake @@ -10,6 +10,7 @@ global.task = Jake.task; global.directory = Jake.directory; //global.file = Jake.file; global.filedir = Jake.filedir; +global.FileList = Jake.FileList; // Read in and set up development environment variables. if (!ENV["BUILD_PATH"]) @@ -77,7 +78,7 @@ if(!global.COMMON_DO_ONCE) // FIXME: is there a better way to do this??? OS.system = function(aCommand) { - system("PATH=$PATH:" + OS.enquote(objectiveJBin) + " " + aCommand) + system("PATH=" + OS.enquote(objectiveJBin) + ":$PATH " + aCommand) } } }