From b88cee2be740af2034348ef725b7d53376647a2e Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Fri, 13 Jun 2008 03:39:26 +0000 Subject: [PATCH] Stop switching different source files into Environment.as's place. Instead build tiny swc's with the player-specific Environment.as and the thane-specific one. Then compile naryalib.swc with one of these tiny swc's as an external library. When we compile the final executables we'll do a inclusive linking to get the right implementation into place. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5182 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- build.xml | 78 ++-- etc/libs-incl.xml | 3 +- etc/thane-config.xml.in | 367 ++++++++++++++++++ .../com/threerings/util/env/Environment.as} | 17 +- .../com/threerings/util/env/Environment.as} | 0 5 files changed, 417 insertions(+), 48 deletions(-) create mode 100644 etc/thane-config.xml.in rename src/{as/com/threerings/util/env/Environment.as-fp => player/com/threerings/util/env/Environment.as} (87%) rename src/{as/com/threerings/util/env/Environment.as-tm => thane/com/threerings/util/env/Environment.as} (100%) diff --git a/build.xml b/build.xml index 21562325a..39e6f9dc0 100644 --- a/build.xml +++ b/build.xml @@ -141,7 +141,6 @@ - @@ -149,7 +148,6 @@ - @@ -174,7 +172,12 @@ - + + + + + + @@ -182,60 +185,51 @@ + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -279,7 +273,7 @@ - + diff --git a/etc/libs-incl.xml b/etc/libs-incl.xml index 8567f9ced..6c8d3f034 100644 --- a/etc/libs-incl.xml +++ b/etc/libs-incl.xml @@ -16,7 +16,6 @@ - - + diff --git a/etc/thane-config.xml.in b/etc/thane-config.xml.in new file mode 100644 index 000000000..ce274a5df --- /dev/null +++ b/etc/thane-config.xml.in @@ -0,0 +1,367 @@ + + + + + + false + + + + false + + true + + + + false + + + + + + + false + + + lib/thane-0.0-SNAPSHOT.swc + + + + true + + + + + + + + @flex_sdk_dir@/frameworks/localFonts.ser + + + flash.fonts.JREFontManager + flash.fonts.AFEFontManager + flash.fonts.BatikFontManager + + + 20 + + 1000 + + + + + + + + + + + + + false + + + + + + en_US + + + + + + + + + http://www.adobe.com/2006/mxml + @flex_sdk_dir@/frameworks/mxml-manifest.xml + + + + true + + + + true + + true + + true + + true + + + + true + + + + true + + true + + false + + true + + true + + true + + true + + true + + true + + true + + true + + true + + true + + false + + false + + true + + true + + false + + true + + true + + true + + true + + true + + false + + true + + true + + true + + true + + true + + true + + false + + false + + true + + false + + false + + true + + true + + false + + + + + 0x869CA7 + + 30 + + + 1000 + 15 + + + + 500 + 375 + + + + + + + + + + + + + + + + + + + + + + Three Rings Design, Inc. + + + + http://www.whirled.com + + EN + + + + + + Three Rings Design, Inc. + + Whirled + + + + + + + + + + + + + true + + + + true + + + + + + + diff --git a/src/as/com/threerings/util/env/Environment.as-fp b/src/player/com/threerings/util/env/Environment.as similarity index 87% rename from src/as/com/threerings/util/env/Environment.as-fp rename to src/player/com/threerings/util/env/Environment.as index 49e926752..6d494a8e6 100644 --- a/src/as/com/threerings/util/env/Environment.as-fp +++ b/src/player/com/threerings/util/env/Environment.as @@ -22,8 +22,7 @@ package com.threerings.util.env { import flash.utils.describeType; - -import com.threerings.util.ClassUtil; +import flash.utils.getDefinitionByName; /** * Flash Player specific implementation of Environment. @@ -69,7 +68,7 @@ public class Environment var exts :XMLList = typeInfo.child("extendsClass").attribute("type"); var type :String; for each (type in exts) { - if (asClass == ClassUtil.getClassByName(type)) { + if (asClass == getClassByName(type)) { return true; } } @@ -78,12 +77,22 @@ public class Environment var imps :XMLList = typeInfo.child("implementsInterface") .attribute("type"); for each (type in imps) { - if (asClass == ClassUtil.getClassByName(type)) { + if (asClass == getClassByName(type)) { return true; } } return false; } + + private static function getClassByName (cname :String) :Class + { + try { + return (getDefinitionByName(cname.replace("::", ".")) as Class); + + } catch (error :ReferenceError) { } + return null; + } } } + diff --git a/src/as/com/threerings/util/env/Environment.as-tm b/src/thane/com/threerings/util/env/Environment.as similarity index 100% rename from src/as/com/threerings/util/env/Environment.as-tm rename to src/thane/com/threerings/util/env/Environment.as