Started moving blend over.

Reviewed by me.
This commit is contained in:
Francisco Tolmasky
2009-03-15 19:36:24 -07:00
parent 101cf4db2c
commit df6ec644e9
17 changed files with 920 additions and 10 deletions
@@ -0,0 +1,120 @@
@import <AppKit/CPTheme.j>
@import <AppKit/CPView.j>
@import "BKUtilities.j"
@implementation BKShowcaseController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView],
bounds = [contentView bounds],
themeDescriptorClasses = BKThemeDescriptorClasses();
var tabView = [[CPTabView alloc] initWithFrame:bounds];
[tabView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[contentView addSubview:tabView];
var count = [themeDescriptorClasses count];
while (count--)
{
var theClass = themeDescriptorClasses[count],
item = [[CPTabViewItem alloc] initWithIdentifier:[theClass themeName]],
templates = BKThemeObjectTemplatesForClass(theClass),
templatesCount = [templates count],
viewTemplates = [],
itemSize = CGSizeMake(0.0, 0.0);
while (templatesCount--)
{
var template = templates[templatesCount],
object = [template valueForKey:@"themedObject"];
if ([object isKindOfClass:[CPView class]])
{
var size = [object frame].size,
labelWidth = [[template valueForKey:@"label"] sizeWithFont:[CPFont boldSystemFontOfSize:12.0]].width + 20.0;
if (size.width > itemSize.width)
itemSize.width = size.width;
if (labelWidth > itemSize.width)
itemSize.width = labelWidth;
if (size.height > itemSize.height)
itemSize.height = size.height;
[viewTemplates addObject:template];
}
}
itemSize.height += 30;
var collectionView = [[CPCollectionView alloc] initWithFrame:CGRectMakeZero()],
collectionViewItem = [[CPCollectionViewItem alloc] init];
[collectionViewItem setView:[[BKShowcaseCell alloc] init]];
[collectionView setItemPrototype:collectionViewItem];
[collectionView setMinItemSize:itemSize];
[collectionView setMaxItemSize:itemSize];
[collectionView setVerticalMargin:5.0];
[collectionView setContent:viewTemplates];
[item setLabel:[theClass themeName]];
[item setView:collectionView];
[tabView addTabViewItem:item];
}
[theWindow orderFront:self];
}
@end
@implementation BKShowcaseCell : CPView
{
CPView _view;
CPTextField _label;
}
- (void)setRepresentedObject:(id)anObject
{
if (!_label)
{
_label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[_label setAlignment:CPCenterTextAlignment];
[_label setAutoresizingMask:CPViewMinYMargin | CPViewWidthSizable];
[_label setFont:[CPFont boldSystemFontOfSize:12.0]];
[self addSubview:_label];
}
[_label setStringValue:[anObject valueForKey:@"label"]];
[_label sizeToFit];
[_label setFrame:CGRectMake(0.0, CGRectGetHeight([self bounds]) - CGRectGetHeight([_label frame]),
CGRectGetWidth([self bounds]), CGRectGetHeight([_label frame]))];
if (_view)
[_view removeFromSuperview];
_view = [anObject valueForKey:@"themedObject"];
[_view setAutoresizingMask:CPViewMinXMargin | CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[_view setFrameOrigin:CGPointMake((CGRectGetWidth([self bounds]) - CGRectGetWidth([_view frame])) / 2.0, (CGRectGetMinY([_label frame]) - CGRectGetHeight([_view frame])) / 2.0)];
[self addSubview:_view];
}
@end
+145
View File
@@ -0,0 +1,145 @@
@implementation AKThemeTemplate : CPObject
{
CPString _name;
CPString _description;
}
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super init];
if (self)
{
_name = [aCoder decodeObjectForKey:@"AKThemeTemplateName"];
_description = [aCoder decodeObjectForKey:@"AKThemeTemplateDescription"];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeObject:_name forKey:@"AKThemeTemplateName"];
[aCoder encodeObject:_description forKey:@"AKThemeTemplateDescription"];
}
@end
@implementation AKThemeObjectTemplate : CPView
{
CPString _label;
id _themedObject;
}
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super init];
if (self)
{
_label = [aCoder decodeObjectForKey:@"AKThemeObjectTemplateLabel"];
_themedObject = [aCoder decodeObjectForKey:@"AKThemeObjectTemplateThemedObject"];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)aCoder
{
[aCoder encodeObject:_label forKey:@"AKThemeObjectTemplateLabel"];
[aCoder encodeObject:_themedObject forKey:@"AKThemeObjectTemplateThemedObject"];
}
@end
function BKThemeDescriptorClasses()
{
// Grab Theme Descriptor Classes.
var themeDescriptorClasses = [];
for (candidate in window)
{
var theClass = objj_getClass(candidate),
theClassName = class_getName(theClass),
index = theClassName.indexOf("ThemeDescriptor");
if ((index >= 0) && (index === theClassName.length - "ThemeDescriptor".length))
themeDescriptorClasses.push(theClass);
}
return themeDescriptorClasses;
}
function BKThemeObjectTemplatesForClass(aClass)
{
var templates = [],
methods = class_copyMethodList(aClass.isa),
count = [methods count];
while (count--)
{
var method = methods[count],
selector = method_getName(method);
if (selector.indexOf("themed") === 0)
{
var impl = method_getImplementation(method),
object = impl(aClass, selector);
if (object)
{
var template = [[AKThemeObjectTemplate alloc] init];
[template setValue:object forKey:@"themedObject"];
[template setValue:BKLabelFromIdentifier(selector) forKey:@"label"];
[templates addObject:template];
}
}
}
return templates;
}
function BKLabelFromIdentifier(anIdentifier)
{
var string = anIdentifier.substr("themed".length);
index = 0,
count = string.length,
label = "",
lastCapital = null,
isLeadingCapital = YES;
for (; index < count; ++index)
{
var character = string.charAt(index),
isCapital = /^[A-Z]/.test(character);
if (isCapital)
{
if (!isLeadingCapital)
{
if (lastCapital === null)
label += ' ' + character.toLowerCase();
else
label += character;
}
lastCapital = character;
}
else
{
if (isLeadingCapital && lastCapital !== null)
label += lastCapital;
label += character;
lastCapital = null;
isLeadingCapital = NO;
}
}
return label;
}
+3
View File
@@ -0,0 +1,3 @@
@import "BKShowcaseController.j"
@import "BKUtilities.j"
+42
View File
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Name</key>
<string>BlendKit</string>
<key>Targets</key>
<array>
<dict>
<key>Name</key>
<string>BlendKit</string>
</dict>
</array>
<key>Configurations</key>
<array>
<dict>
<key>Name</key>
<string>Debug</string>
<key>Flags</key>
<string>-DDEBUG -DPLATFORM_DOM -g</string>
</dict>
<dict>
<key>Name</key>
<string>Release</string>
<key>Flags</key>
<string>-DPLATFORM_DOM -O</string>
</dict>
<dict>
<key>Name</key>
<string>Debug-Rhino</string>
<key>Flags</key>
<string>-DDEBUG -g</string>
</dict>
<dict>
<key>Name</key>
<string>Release-Rhino</string>
<key>Flags</key>
<string>-O</string>
</dict>
</array>
</dict>
</plist>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CPBundleIdentifier</key>
<string>com.280n.BlendKit</string>
<key>CPBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CPBundleName</key>
<string>BlendKit</string>
<key>CPBundlePackageType</key>
<string>FMWK</string>
</dict>
</plist>
+33
View File
@@ -0,0 +1,33 @@
<?xml version = "1.0"?>
<project name = "BlendKit" default = "build" basedir = "." >
<import file = "../../../common.xml" />
<import file = "${env.OBJJ_LIB}/steam/steam.xml" />
<target name = "clean" depends = "steam-uptodate">
<steam-build>
<arg line = "-f BlendKit.steam -c ${Configuration} clean" />
</steam-build>
<steam-build>
<arg line = "-f BlendKit.steam -c ${Configuration}-Rhino clean" />
</steam-build>
</target>
<target name = "build" depends = "steam-uptodate">
<steam-build>
<arg line = "-f BlendKit.steam -c ${Configuration}" />
</steam-build>
<steam-build>
<arg line = "-f BlendKit.steam -c ${Configuration}-Rhino" />
</steam-build>
<!-- <copy file = "../LICENSE" todir = "${Build}/${Configuration}/AppKit" />-->
</target>
</project>
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env ruby
require 'rake'
require '../../../common'
require 'objective-j'
require 'objective-j/bundle'
$PRODUCT = 'BlendKit' + $CONFIGURATION
$ENVIRONMENT_PRODUCT = File.join($ENVIRONMENT_FRAMEWORKS_DIR, 'BlendKit')
task :build => [$PRODUCT, $ENVIRONMENT_PRODUCT]
Specs = {}
# Debug Framework
Specs[:BlendKitDebug] = ObjectiveJ::BundleSpecification.new do |s|
s.name = 'BlendKit'
s.identifier = 'com.280n.BlendKit'
s.version = '0.6.5'
s.author = '280 North, Inc.'
s.email = 'feedback @nospam@ 280north.com'
s.summary = 'BlendKit classes for Cappuccino'
s.sources = FileList['**/*.j']
s.resources = FileList['Resources/*']
s.license = ObjectiveJ::License::LGPL_v2_1
s.build_path = File.join($BUILD_DIR, 'Debug', 'BlendKit')
s.intermediates_path = File.join($BUILD_DIR, 'BlendKit.build', 'Debug')
s.flag = 'DEBUG'
end
bundle Specs[:BlendKitDebug], :BlendKitDebug
# Release Framework
Specs[:BlendKitRelease] = ObjectiveJ::BundleSpecification.new do |s|
s.name = 'BlendKit'
s.identifier = 'com.280n.BlendKit'
s.version = '0.6.5'
s.author = '280 North, Inc.'
s.email = 'feedback @nospam@ 280north.com'
s.summary = 'BlendKit classes for Cappuccino'
s.sources = FileList['**/*.j']
s.resources = FileList['Resources/*']
s.license = ObjectiveJ::License::LGPL_v2_1
s.build_path = File.join($BUILD_DIR, 'Release', 'BlendKit')
s.intermediates_path = File.join($BUILD_DIR, 'BlendKit.build', 'Release')
end
bundle Specs[:BlendKitRelease], :BlendKitRelease
#Framework in environment directory
file_d $ENVIRONMENT_PRODUCT => [$PRODUCT] do
cp_r(Specs[$PRODUCT.to_sym].build_path, $ENVIRONMENT_PRODUCT)
end
+57
View File
@@ -0,0 +1,57 @@
#!/bin/sh
#
# blend
# blend
#
# Created by Francisco Tolmasky.
# Copyright 2008, 280 North, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# if OBJJ_HOME isn't set, try to determine it
if [ -z $OBJJ_HOME ]; then
# get path of the executable
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
# resolve symlinks
if [ -h $SELF_PATH ]; then
SELF_PATH=`readlink $SELF_PATH`
fi
# get second ancestor directory
SELF_DIR=`dirname $SELF_PATH`
export OBJJ_HOME=`dirname $SELF_DIR`
# check to ensure it exists, print message
if [ -d $OBJJ_HOME ]; then
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
else
echo "OBJJ_HOME not set, default at $OBJJ_HOME doesn't exist, exiting" 1>&2
exit 2
fi
fi
OBJJ_LIB="$OBJJ_HOME/lib"
BLEND="$OBJJ_LIB/blend/main.j"
# convert paths for Cygwin
if [[ `uname` == CYGWIN* ]]; then
OBJJ_HOME=`cygpath -w "$OBJJ_HOME"`
BAKE=`cygpath -w "$BLEND"`
fi
objj $BLEND $@
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Name</key>
<string>blend</string>
<key>Targets</key>
<array>
<dict>
<key>Name</key>
<string>blend</string>
<key>Excluded</key>
<array>
<string>BlendKit</string>
</array>
</dict>
</array>
<key>Configurations</key>
<array>
<dict>
<key>Name</key>
<string>Debug</string>
<key>Flags</key>
<string>-DDEBUG -DPLATFORM_DOM -g</string>
</dict>
<dict>
<key>Name</key>
<string>Release</string>
<key>Flags</key>
<string>-DPLATFORM_DOM -O</string>
</dict>
<dict>
<key>Name</key>
<string>Debug-Rhino</string>
<key>Flags</key>
<string>-DDEBUG -g</string>
</dict>
<dict>
<key>Name</key>
<string>Release-Rhino</string>
<key>Flags</key>
<string>-O</string>
</dict>
</array>
</dict>
</plist>
+23
View File
@@ -0,0 +1,23 @@
<?xml version = "1.0"?>
<project name = "blend" default = "build" basedir = "." >
<import file = "../../../common.xml" />
<import file = "${env.OBJJ_LIB}/steam/steam.xml" />
<target name = "clean" depends = "steam-uptodate">
<steam-build>
<arg line = "-f blend.steam -c ${Configuration} clean" />
</steam-build>
</target>
<target name = "build" depends = "steam-uptodate">
<steam-build>
<arg line = "-f blend.steam -c ${Configuration}" />
</steam-build>
</target>
</project>
+298
View File
@@ -0,0 +1,298 @@
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@import <AppKit/CPCib.j>
@import <AppKit/CPTheme.j>
@import <BlendKit/BlendKit.j>
importClass(java.io.File);
importClass(java.io.FileOutputStream);
importClass(java.io.BufferedWriter);
importClass(java.io.OutputStreamWriter);
function main()
{
var index = 0,
count = arguments.length,
outputFilePath = "",
descriptorFiles = [],
resourcesPath = nil,
cibFiles = [];
for (; index < count; ++index)
{
var argument = arguments[index];
switch (argument)
{
case "-c":
case "--cib": cibFiles.push(arguments[++index]);
break;
case "-d":
case "-descriptor": descriptorFiles.push(arguments[++index]);
break;
case "-o": outputFilePath = arguments[++index];
break;
case "-R": resourcesPath = arguments[++index];
break;
default: jExtensionIndex = argument.indexOf(".j");
if ((jExtensionIndex > 0) && (jExtensionIndex === argument.length - ".j".length))
descriptorFiles.push(argument);
else
cibFiles.push(argument);
}
}
if (descriptorFiles.length === 0)
return buildBlendFromCibFiles(cibFiles);
objj_import(descriptorFiles, YES, function()
{
var themeDescriptorClasses = BKThemeDescriptorClasses(),
count = [themeDescriptorClasses count];
while (count--)
{
var theClass = themeDescriptorClasses[count],
themeTemplate = [[AKThemeTemplate alloc] init];
[themeTemplate setValue:[theClass themeName] forKey:@"name"];
var objectTemplates = BKThemeObjectTemplatesForClass(theClass);
data = cibDataFromTopLevelObjects(objectTemplates.concat([themeTemplate])),
temporaryCibFile = File.createTempFile("temp", ".cib"),
temporaryCibFilePath = temporaryCibFile.getAbsolutePath(),
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(temporaryCibFilePath), "UTF-8"));
writer.write([data string]);
writer.close();
cibFiles.push(temporaryCibFilePath);
}
buildBlendFromCibFiles(cibFiles, outputFilePath, resourcesPath);
});
}
function cibDataFromTopLevelObjects(objects)
{
var data = [CPData data],
archiver = [[CPKeyedArchiver alloc] initForWritingWithMutableData:data],
objectData = [[_CPCibObjectData alloc] init];
objectData._fileOwner = [_CPCibCustomObject new];
objectData._fileOwner._className = @"CPObject";
var index = 0,
count = objects.length;
for (; index < count; ++index)
{
objectData._objectsValues[index] = objectData._fileOwner;
objectData._objectsKeys[index] = objects[index];
}
[archiver encodeObject:objectData forKey:@"CPCibObjectDataKey"];
[archiver finishEncoding];
return data;
}
function getDirectory(aPath)
{
return (aPath).substr(0, (aPath).lastIndexOf('/') + 1)
}
function buildBlendFromCibFiles(cibFiles, outputFilePath, resourcesPath)
{
var resourcesFile = nil;
if (resourcesPath)
resourcesFile = new File(resourcesPath);
var count = cibFiles.length,
replacedFiles = [],
staticContent = @"";
while (count--)
{
var theme = themeFromCibFile(new File(cibFiles[count])),
// Archive our theme.
filePath = [theme name] + ".keyedtheme",
fileContents = [[CPKeyedArchiver archivedDataWithRootObject:theme] string];
replacedFiles.push(filePath);
staticContent += MARKER_PATH + ';' + filePath.length + ';' + filePath + MARKER_TEXT + ';' + fileContents.length + ';' + fileContents;
}
staticContent = "@STATIC;1.0;" + staticContent;
var infoDictionary = [CPDictionary dictionary];
staticContentName = "Aristo";//getFileNameWithoutExtension(project.activeTarget().name());
[infoDictionary setObject:@"Yikes." forKey:@"CPBundleName"];
[infoDictionary setObject:@"Yikes." forKey:@"CPBundleIdentifier"];
[infoDictionary setObject:replacedFiles forKey:@"CPBundleReplacedFiles"];
[infoDictionary setObject:staticContentName forKey:@"CPBundleExecutable"];
var outputFile = new File(outputFilePath).getCanonicalFile();
outputFile.mkdirs();
var writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFilePath + "/Info.plist"), "UTF-8"));
writer.write(CPPropertyListCreate280NorthData(infoDictionary).string);
writer.close();
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFilePath + '/' + staticContentName), "UTF-8"));
writer.write(staticContent);
writer.close();
if (resourcesPath)
rsync(new File(resourcesPath), new File(outputFilePath));
}
function themeFromCibFile(aFile)
{
var cib = [[CPCib alloc] initWithContentsOfURL:aFile.getCanonicalPath()],
topLevelObjects = [];
[cib _setAwakenCustomResources:NO];
[cib instantiateCibWithExternalNameTable:[CPDictionary dictionaryWithObject:topLevelObjects forKey:CPCibTopLevelObjects]];
var count = topLevelObjects.length,
theme = nil,
templates = [];
while (count--)
{
var object = topLevelObjects[count];
templates = templates.concat([object blendThemeObjectTemplates]);
if ([object isKindOfClass:[AKThemeTemplate class]])
theme = [[CPTheme alloc] initWithName:[object valueForKey:@"name"]];
}
[templates makeObjectsPerformSelector:@selector(blendAddThemedObjectAttributesToTheme:) withObject:theme];
return theme;
}
function rsync(srcFile, dstFile)
{
var src, dst;
if (String(java.lang.System.getenv("OS")).indexOf("Windows") < 0)
{
src = srcFile.getAbsolutePath();
dst = dstFile.getAbsolutePath();
}
else
{
src = exec(["cygpath", "-u", srcFile.getAbsolutePath() + '/']);
dst = exec(["cygpath", "-u", dstFile.getAbsolutePath() + "/Resources"]);
}
if (srcFile.exists())
exec(["rsync", "-avz", src, dst]);
}
function exec(/*Array*/ command, /*Boolean*/ showOutput)
{
var line = "",
output = "",
process = Packages.java.lang.Runtime.getRuntime().exec(command),//jsArrayToJavaArray(command));
reader = new Packages.java.io.BufferedReader(new Packages.java.io.InputStreamReader(process.getInputStream()));
while (line = reader.readLine())
{
if (showOutput)
System.out.println(line);
output += line + '\n';
}
reader = new Packages.java.io.BufferedReader(new Packages.java.io.InputStreamReader(process.getErrorStream()));
while (line = reader.readLine())
System.out.println(line);
try
{
if (process.waitFor() != 0)
System.err.println("exit value = " + process.exitValue());
}
catch (anException)
{
System.err.println(anException);
}
return output;
}
@implementation CPObject (BlendAdditions)
- (CPArray)blendThemeObjectTemplates
{
var theClass = [self class];
if ([theClass isKindOfClass:[AKThemeObjectTemplate class]])
return [self];
if ([theClass isKindOfClass:[CPView class]])
{
var templates = [],
subviews = [self subviews],
count = [subviews count];
while (count--)
templates = templates.concat([subviews[count] blendThemeObjectTemplates]);
return templates;
}
return [];
}
@end
@implementation AKThemeObjectTemplate (BlendAdditions)
- (void)blendAddThemedObjectAttributesToTheme:(CPTheme)aTheme
{
var themedObject = [self valueForKey:@"themedObject"];
if (!themedObject)
{
var subviews = [self subviews];
if ([subviews count] > 0)
themedObject = subviews[0];
}
if (themedObject)
{
print(" Recording theme for " + [themedObject className] + ".");
[aTheme takeThemeFromObject:themedObject];
}
}
@end
main.apply(main, args);
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env ruby
require 'rake'
require '../../../common'
require 'objective-j'
require 'objective-j/bundle'
$PRODUCT = 'blend' + $CONFIGURATION
$ENVIRONMENT_BIN_PRODUCT = File.join($ENVIRONMENT_BIN_DIR, 'blend')
$ENVIRONMENT_LIB_PRODUCT = File.join($ENVIRONMENT_LIB_DIR, 'blend')
task :build => [$PRODUCT, $ENVIRONMENT_BIN_PRODUCT, $ENVIRONMENT_LIB_PRODUCT]
Specs = {}
# Debug Framework
Specs[:blendDebug] = ObjectiveJ::BundleSpecification.new do |s|
s.name = 'blend'
s.identifier = 'com.280n.blend'
s.version = '0.6.5'
s.author = '280 North, Inc.'
s.email = 'feedback @nospam@ 280north.com'
s.summary = 'blend classes for Cappuccino'
s.sources = FileList['**/*.j']
s.resources = FileList['Resources/*']
s.license = ObjectiveJ::License::LGPL_v2_1
s.build_path = File.join($BUILD_DIR, 'Debug', 'blend')
s.intermediates_path = File.join($BUILD_DIR, 'blend.build', 'Debug')
s.flag = 'DEBUG'
end
bundle Specs[:blendDebug], :blendDebug
# Release Framework
Specs[:blendRelease] = ObjectiveJ::BundleSpecification.new do |s|
s.name = 'blend'
s.identifier = 'com.280n.blend'
s.version = '0.6.5'
s.author = '280 North, Inc.'
s.email = 'feedback @nospam@ 280north.com'
s.summary = 'blend classes for Cappuccino'
s.sources = FileList['**/*.j']
s.resources = FileList['Resources/*']
s.license = ObjectiveJ::License::LGPL_v2_1
s.build_path = File.join($BUILD_DIR, 'Release', 'blend')
s.intermediates_path = File.join($BUILD_DIR, 'blend.build', 'Release')
end
bundle Specs[:blendRelease], :blendRelease
#executable in environment directory
file_d $ENVIRONMENT_BIN_PRODUCT do
make_objj_executable($ENVIRONMENT_BIN_PRODUCT)
end
file_d $ENVIRONMENT_LIB_PRODUCT => [$PRODUCT] do
cp_r(Specs[$PRODUCT.to_sym].build_path, $ENVIRONMENT_LIB_PRODUCT)
end
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
require 'rake'
require '../../common'
subprojects = %w{BlendKit blend}
%w(build clean).each do |task_name|
task task_name do
subrake(subprojects)
end
end
+5 -1
View File
@@ -9,11 +9,15 @@ require 'objective-j/bundle'
$PRODUCT = 'AppKit' + $CONFIGURATION
$ENVIRONMENT_PRODUCT = File.join($ENVIRONMENT_FRAMEWORKS_DIR, 'AppKit')
subprojects = %w{Tools}
subrake(subprojects)
task :build => [$PRODUCT, $ENVIRONMENT_PRODUCT]
Specs = {}
AppKitFiles = FileList['**/*.j'].exclude('CoreGraphics/CGContextCanvas.j', 'CoreGraphics/CGContextVML.j', 'Themes/**')
AppKitFiles = FileList['**/*.j'].exclude('CoreGraphics/CGContextCanvas.j', 'CoreGraphics/CGContextVML.j', 'Themes/**', 'Tools/**')
# Debug Framework
Specs[:AppKitDebug] = ObjectiveJ::BundleSpecification.new do |s|
+4 -4
View File
@@ -39,8 +39,8 @@ var objj_files = { },
var OBJJ_NO_FILE = {};
if (!window.OBJJ_INCLUDE_PATHS)
var OBJJ_INCLUDE_PATHS = ["Frameworks", "SomethingElse"];
if (typeof OBJJ_INCLUDE_PATHS === "undefined")
OBJJ_INCLUDE_PATHS = ["Frameworks", "SomethingElse"];
var OBJJ_BASE_URI = "";
@@ -127,7 +127,7 @@ objj_search.prototype.attemptNextSearchPath = function()
{
var searchPath = this.nextSearchPath(),
file = objj_files[searchPath];
objj_alert("Will attempt to find " + this.filePath + " at " + searchPath);
// If a file for this search path already exists, then it has already been downloaded.
@@ -150,7 +150,7 @@ objj_search.prototype.attemptNextSearchPath = function()
}
var existingSearch = objj_searches[searchPath];
// If there is already an ongoing search for this search path, then we can let it find
// the file for us. Make sure to assign it our callback, if we have one, since only
// one search can have a callback at a time.
+2 -3
View File
@@ -17,12 +17,11 @@ if (!this.objj_import)
load(OBJJ_LIB+'/Frameworks-Rhino/Objective-J/Objective-J.js');
}
*/
OBJJ_INCLUDE_PATHS = [];
var OBJJ_INCLUDE_PATHS_STRING = getenv("OBJJ_INCLUDE_PATHS");
if (OBJJ_INCLUDE_PATHS_STRING)
OBJJ_INCLUDE_PATHS = OBJJ_INCLUDE_PATHS.concat(OBJJ_INCLUDE_PATHS_STRING.split(":"));
OBJJ_INCLUDE_PATHS = OBJJ_INCLUDE_PATHS_STRING.split(":").concat(OBJJ_INCLUDE_PATHS);
try
{
@@ -35,7 +34,7 @@ try
args[count] = String(args[count]);
while (args.length && args[0].indexOf('-I') === 0)
OBJJ_INCLUDE_PATHS = OBJJ_INCLUDE_PATHS.concat(args.shift().substr(2).split(':'))
OBJJ_INCLUDE_PATHS = args.shift().substr(2).split(':').concat(OBJJ_INCLUDE_PATHS);
}
if (args.length > 0)
+2 -2
View File
@@ -24,7 +24,7 @@
#fi
OBJJ_LIB="$OBJJ_HOME/lib"
FRAMEWORKS="$OBJJ_HOME/lib/Frameworks"
MAIN="$OBJJ_LIB/$(basename $SELF_PATH)/main.j"
# convert paths for Cygwin
@@ -33,4 +33,4 @@ if [[ `uname` == CYGWIN* ]]; then
BAKE=`cygpath -w "$BLEND"`
fi
objj $MAIN $@
objj -I$FRAMEWORKS $MAIN $@