Class: Buildr::AS3::Flex::FlexSDK
- Inherits:
-
Object
- Object
- Buildr::AS3::Flex::FlexSDK
- Defined in:
- lib/buildr/as3/flexsdk.rb
Instance Attribute Summary collapse
-
#adl ⇒ Object
readonly
Returns the value of attribute adl.
-
#adt_jar ⇒ Object
readonly
Returns the value of attribute adt_jar.
-
#air_config ⇒ Object
Returns the value of attribute air_config.
-
#asdoc_jar ⇒ Object
readonly
Returns the value of attribute asdoc_jar.
-
#asdoc_templates ⇒ Object
Returns the value of attribute asdoc_templates.
-
#bin ⇒ Object
readonly
Returns the value of attribute bin.
-
#compc_jar ⇒ Object
readonly
Returns the value of attribute compc_jar.
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
-
#fcsh_jar ⇒ Object
readonly
Returns the value of attribute fcsh_jar.
-
#flex_config ⇒ Object
Returns the value of attribute flex_config.
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#mxmlc_jar ⇒ Object
readonly
Returns the value of attribute mxmlc_jar.
Instance Method Summary collapse
- #from(url) ⇒ Object
-
#initialize(version) ⇒ FlexSDK
constructor
A new instance of FlexSDK.
- #invoke ⇒ Object
Constructor Details
#initialize(version) ⇒ FlexSDK
Returns a new instance of FlexSDK.
36 37 38 39 40 41 42 43 44 |
# File 'lib/buildr/as3/flexsdk.rb', line 36 def initialize(version) @version = version @default_options = {} @spec = "com.adobe.flex:sdk:zip:#{@version}" @sdk_zip = Buildr.artifact(@spec) @sdk_dir = File.join(File.dirname(@sdk_zip.to_s), "sdk-#{@version}") generate_paths @sdk_dir self end |
Instance Attribute Details
#adl ⇒ Object (readonly)
Returns the value of attribute adl.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def adl @adl end |
#adt_jar ⇒ Object (readonly)
Returns the value of attribute adt_jar.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def adt_jar @adt_jar end |
#air_config ⇒ Object
Returns the value of attribute air_config.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def air_config @air_config end |
#asdoc_jar ⇒ Object (readonly)
Returns the value of attribute asdoc_jar.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def asdoc_jar @asdoc_jar end |
#asdoc_templates ⇒ Object
Returns the value of attribute asdoc_templates.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def asdoc_templates @asdoc_templates end |
#bin ⇒ Object (readonly)
Returns the value of attribute bin.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def bin @bin end |
#compc_jar ⇒ Object (readonly)
Returns the value of attribute compc_jar.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def compc_jar @compc_jar end |
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def @default_options end |
#fcsh_jar ⇒ Object (readonly)
Returns the value of attribute fcsh_jar.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def fcsh_jar @fcsh_jar end |
#flex_config ⇒ Object
Returns the value of attribute flex_config.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def flex_config @flex_config end |
#home ⇒ Object (readonly)
Returns the value of attribute home.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def home @home end |
#mxmlc_jar ⇒ Object (readonly)
Returns the value of attribute mxmlc_jar.
31 32 33 |
# File 'lib/buildr/as3/flexsdk.rb', line 31 def mxmlc_jar @mxmlc_jar end |
Instance Method Details
#from(url) ⇒ Object
79 80 81 82 |
# File 'lib/buildr/as3/flexsdk.rb', line 79 def from(url) @url = url self end |
#invoke ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/buildr/as3/flexsdk.rb', line 46 def invoke @url ||= generate_url_from_version @version if Buildr::Util.win_os? unless File.exists? @sdk_zip.to_s FileUtils.mkdir_p File.dirname(@sdk_zip.to_s) unless File.directory? File.dirname(@sdk_zip.to_s) File.open @sdk_zip.to_s, 'w' do |file| file.binmode() URI.read(@url, {:progress=>true}) { |chunk| file.write chunk } end end else Buildr.artifact(@spec).from(Buildr.download(@url)).invoke unless File.exists? @sdk_zip.to_s end unless File.exists? @sdk_dir puts "Unzipping FlexSDK, this might take a while." if Buildr::Util.win_os? puts "Please make sure unzip is installed and in your PATH variable!" unzip @sdk_zip, @sdk_dir else begin Buildr.unzip(@sdk_dir.to_s=>@sdk_zip.to_s).target.invoke rescue TypeError puts "RubyZip extract failed, trying system unzip now." unzip @sdk_zip, @sdk_dir end end end self end |