mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-13 02:08:55 +00:00
Fix for Cappuccino no longer being compressed in release builds.
Closes #33. Reviewed by me.
This commit is contained in:
1 parent
c5f4e0a268
commit
0cd33120cf
11 files changed
+22
-24
No files matched your search
+2
-1
@@ -25,7 +25,8 @@ ObjectiveJ::BundleTask.new(:AppKit) do |t|
|
||||
t.resources = FileList['Resources/*']
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
t.platforms = [ObjectiveJ::Platform::Browser, ObjectiveJ::Platform::Rhino]
|
||||
t.type = ObjectiveJ::Bundle::Type::Framework
|
||||
end
|
||||
|
||||
@@ -20,7 +20,8 @@ ObjectiveJ::BundleTask.new(:BlendKit) do |t|
|
||||
t.resources = FileList['Resources/*'].to_a
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
t.type = ObjectiveJ::Bundle::Type::Framework
|
||||
end
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ ObjectiveJ::BundleTask.new(:blend) do |t|
|
||||
t.resources = FileList['Resources/*']
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Debug'
|
||||
end
|
||||
|
||||
#executable in environment directory
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@ ObjectiveJ::BundleTask.new(:Foundation) do |t|
|
||||
t.resources = FileList['Resources/*'].to_a
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
t.type = ObjectiveJ::Bundle::Type::Framework
|
||||
end
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ function compress(/*String*/ aCode, /*Object*/ flags, /*File*/ tmpFile)
|
||||
|
||||
writer.close();
|
||||
|
||||
return exec(["java", "-jar", OBJJ_HOME + "/lib/shrinksafe.jar", "-c", tmpFile.getCanonicalPath()]);
|
||||
return exec(["java", "-jar", OBJJ_HOME + "/lib/objjc/shrinksafe.jar", "-c", tmpFile.getCanonicalPath()]);
|
||||
}
|
||||
|
||||
//#define SET_CONTEXT(aFragment, aContext) aFragment.context = aContext
|
||||
|
||||
@@ -56,13 +56,3 @@ def file_d(*args, &block)
|
||||
|
||||
file fileTask.name => fileDirectory
|
||||
end
|
||||
|
||||
def resolve_flags(flags)
|
||||
|
||||
case flags
|
||||
when nil then ''
|
||||
when String then '-D' + flags
|
||||
when Array then flags.map { |flag| '-D' + flag }.join(' ')
|
||||
when Hash then flags.map { |flag, value| '-D' + flag + (value != '' ? '=' + value : '') }.join(' ')
|
||||
end
|
||||
end
|
||||
@@ -350,10 +350,10 @@ module ObjectiveJ
|
||||
PLATFORM_FLAGS =
|
||||
{
|
||||
Platform::ObjJ => [],
|
||||
Platform::Rhino => ['PLATFORM_RHINO'],
|
||||
Platform::Browser => ['PLATFORM_BROWSER', 'PLATFORM_DOM'],
|
||||
Platform::BrowserDesktop => ['PLATFORM_BROWSER', 'PLATFORM_DOM', 'PLATFORM_DESKTOP'],
|
||||
Platform::BrowserIPhone => ['PLATFORM_BROWSER', 'PLATFORM_DOM', 'PLATFORM_IPHONE', 'PLATFORM_MOBILE']
|
||||
Platform::Rhino => ['-DPLATFORM_RHINO'],
|
||||
Platform::Browser => ['-DPLATFORM_BROWSER', '-DPLATFORM_DOM'],
|
||||
Platform::BrowserDesktop => ['-DPLATFORM_BROWSER', '-DPLATFORM_DOM', '-DPLATFORM_DESKTOP'],
|
||||
Platform::BrowserIPhone => ['-DPLATFORM_BROWSER', '-DPLATFORM_DOM', '-DPLATFORM_IPHONE', '-DPLATFORM_MOBILE']
|
||||
}
|
||||
|
||||
# Objective-J Bundle spec containing the metadata for this bundle.
|
||||
@@ -451,7 +451,7 @@ module ObjectiveJ
|
||||
# We no longer get this for free with file_d
|
||||
FileUtils.mkdir_p File.join(build_path, PLATFORM_DIRECTORIES[platform])
|
||||
|
||||
IO.popen("objjc #{resolve_flags(flags)} #{resolve_flags(PLATFORM_FLAGS[platform])} #{platform_sources.join(' ')} #{preprocessed_files.join(' ')}") do |objjc|
|
||||
IO.popen("objjc #{flags.join(' ')} #{PLATFORM_FLAGS[platform].join(' ')} #{platform_sources.join(' ')} #{preprocessed_files.join(' ')}") do |objjc|
|
||||
objjc.sync = true
|
||||
|
||||
while str = objjc.gets
|
||||
|
||||
+2
-1
@@ -23,7 +23,8 @@ ObjectiveJ::BundleTask.new(:bake) do |t|
|
||||
t.resources = FileList['Resources/*']
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
end
|
||||
|
||||
#executable in environment directory
|
||||
|
||||
+2
-1
@@ -22,7 +22,8 @@ ObjectiveJ::BundleTask.new(:capp) do |t|
|
||||
t.resources = FileList['Resources/*', 'Templates']
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
end
|
||||
|
||||
#executable in environment directory
|
||||
|
||||
@@ -22,7 +22,8 @@ ObjectiveJ::BundleTask.new(:nib2cib) do |t|
|
||||
t.resources = FileList['Resources/*']
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
end
|
||||
|
||||
#executable in environment directory
|
||||
|
||||
@@ -24,7 +24,8 @@ ObjectiveJ::BundleTask.new(:press) do |t|
|
||||
t.resources = FileList['Resources/*']
|
||||
t.license = ObjectiveJ::License::LGPL_v2_1
|
||||
t.build_path = $BUILD_PATH
|
||||
t.flag = 'DEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-DDEBUG' if $CONFIGURATION == 'Debug'
|
||||
t.flag = '-O' if $CONFIGURATION == 'Release'
|
||||
end
|
||||
|
||||
#executable in environment directory
|
||||
|
||||
Reference in new issue
Block a user