Class: Sprout::ADTTask

Inherits:
ToolTask
  • Object
show all
Defined in:
lib/sprout/tasks/adt_task.rb,
lib/sprout/tasks/adl_documentation.rb

Overview

The ADT Task provides Rake support for the AIR Developer Tool package command. livedocs.adobe.com/flex/3/html/CommandLineTools_5.html#1035876

The following example can be pasted in a file named ‘rakefile.rb’:

# Create an ADL task named :run dependent upon the swf that it is using for the window content
adt :package => 'SomeProject.swf' do |t|
  t.storetype = "PKCS12"
  t.keystore = "cert.p12"
  t.output = "bin/TestProj.air"
  t.application_descriptor = "src/SomeProject-app.xml"
  t.files = [ "assets", "skins" ]
end

Instance Method Summary collapse

Instance Method Details

#alias=(string) ⇒ Object

The alias of a key in the keystore. Specifying an alias is not

necessary when a keystore only contains a single certificate. If no 
alias is specified, ADT uses the first key in the keystore.


11
12
13
# File 'lib/sprout/tasks/adl_documentation.rb', line 11

def alias=(string)
  @alias = string
end

#application_descriptor=(file) ⇒ Object

The path to the application descriptor file. The path can be specified

relative to the current directory or as an absolute path. (The 
application descriptor file is renamed as "application.xml" in the AIR 
file.)


70
71
72
# File 'lib/sprout/tasks/adl_documentation.rb', line 70

def application_descriptor=(file)
  @application_descriptor = file
end

#defineObject

:nodoc:



141
142
143
144
145
146
147
148
149
# File 'lib/sprout/tasks/adt_task.rb', line 141

def define # :nodoc:
  super

  if(!output)
    self.output = name
  end

  CLEAN.add(output)
end

#files=(files) ⇒ Object

The files and directories to package in the AIR file. Any number of

files and directories can be specified, delimited by whitespace. If you
list a directory, all files and subdirectories within, except hidden 
files, are added to the package. (In addition, if the application 
descriptor file is specified, either directly, or through wildcard or 
directory expansion, it is ignored and not added to the package a 
second time.) Files and directories specified must be in the current 
directory or one of its subdirectories. Use the -C option to change the 
current directory.


83
84
85
# File 'lib/sprout/tasks/adl_documentation.rb', line 83

def files=(files)
  @files = files
end

#initialize_taskObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/sprout/tasks/adt_task.rb', line 20

def initialize_task
  super
  @default_gem_name = 'sprout-flex3sdk-tool'
  @default_gem_path = 'bin/adt'

  # Package command is "adt -package"
  add_param(:package, :boolean) do |p|
    p.description = "Using -package option as default."
    p.value = true
    p.hidden_value = true
  end

  #
  # Signing options
  #
  
  add_param(:alias, :string) do |p|
    p.delimiter = " "
    p.description = <<-DESC
    The alias of a key in the keystore. Specifying an alias is not 
    necessary when a keystore only contains a single certificate. If no 
    alias is specified, ADT uses the first key in the keystore.
    DESC
  end
  
  add_param(:storetype, :string) do |p|
    p.delimiter = " "
    p.description = <<-DESC
    The type of keystore, determined by the keystore implementation. The 
    default keystore implementation included with most installations of 
    Java supports the JKS and PKCS12 types. Java 5.0 includes support for 
    the PKCS11 type, for accessing keystores on hardware tokens, and 
    Keychain type, for accessing the Mac OS-X keychain. Java 6.0 includes 
    support for the MSCAPI type (on Windows). If other JCA providers have 
    been installed and configured, additional keystore types might be 
    available. If no keystore type is specified, the default type for the 
    default JCA provider is used.
    DESC
  end
  
  add_param(:providerName, :string) do |p|
    p.delimiter = " "
    p.description = <<-DESC
    The JCA provider for the specified keystore type. If not specified, 
    then ADT uses the default provider for that type of keystore.
    DESC
  end      
  
  add_param(:keystore, :file) do |p|
    p.delimiter = " "
    p.description = "The path to the keystore file for file-based store types."
  end
  
  add_param(:storepass, :string) do |p|
    p.delimiter = " "
    p.description = <<-DESC
    The password required to access the keystore. If not specified, ADT 
    prompts for the password.
    DESC
  end
  
  add_param(:keypass, :string) do |p|
    p.delimiter = " "
    p.description = <<-DESC
    The password required to access the private key that will be used to 
    sign the AIR application. If not specified, ADT prompts for the password.
    DESC
  end
  
  add_param(:tsa, :url) do |p|
    p.delimiter = " "
    p.description = <<-DESC
    Specifies the URL of an RFC3161-compliant time stamp server to time 
    stamp the digital signature. If no URL is specified, a default time 
    stamp server provided by Geotrust is used. When the signature of an AIR
    application is time stamped, the application can still be installed 
    after the signing certificate expires, because the time stamp verifies 
    that the certificate was valid at the time of signing. 
    DESC
  end
  
  #
  # ADT package options
  #

  add_param(:output, :file) do |p|
    p.hidden_name = true
    p.required = true
    p.description = "The name of the AIR file to be created."
  end
  
  add_param(:application_descriptor, :file) do |p|
    p.hidden_name = true
    p.delimiter = " "
    p.required = true
    p.description = <<-DESC
    The path to the application descriptor file. The path can be specified 
    relative to the current directory or as an absolute path. (The 
    application descriptor file is renamed as "application.xml" in the AIR 
    file.)
    DESC
  end

  add_param(:files, :files) do |p|
    # Work-around for shell name not being hidden on files param type
    p.instance_variable_set(:@shell_name, "")        
    p.hidden_name = true
    p.delimiter = ""        
    p.description = <<-DESC
    The files and directories to package in the AIR file. Any number of 
    files and directories can be specified, delimited by whitespace. If you
    list a directory, all files and subdirectories within, except hidden 
    files, are added to the package. (In addition, if the application 
    descriptor file is specified, either directly, or through wildcard or 
    directory expansion, it is ignored and not added to the package a 
    second time.) Files and directories specified must be in the current 
    directory or one of its subdirectories. Use the -C option to change the 
    current directory.
    DESC
  end

  def define # :nodoc:
    super

    if(!output)
      self.output = name
    end

    CLEAN.add(output)
  end
        
end

#keypass=(string) ⇒ Object

The password required to access the private key that will be used to

sign the AIR application. If not specified, ADT prompts for the password.


47
48
49
# File 'lib/sprout/tasks/adl_documentation.rb', line 47

def keypass=(string)
  @keypass = string
end

#keystore=(file) ⇒ Object

The path to the keystore file for file-based store types.



35
36
37
# File 'lib/sprout/tasks/adl_documentation.rb', line 35

def keystore=(file)
  @keystore = file
end

#output=(file) ⇒ Object

The name of the AIR file to be created.



62
63
64
# File 'lib/sprout/tasks/adl_documentation.rb', line 62

def output=(file)
  @output = file
end

#package=(boolean) ⇒ Object

Using -package option as default.



4
5
6
# File 'lib/sprout/tasks/adl_documentation.rb', line 4

def package=(boolean)
  @package = boolean
end

#providerName=(string) ⇒ Object

The JCA provider for the specified keystore type. If not specified,

then ADT uses the default provider for that type of keystore.


30
31
32
# File 'lib/sprout/tasks/adl_documentation.rb', line 30

def providerName=(string)
  @providerName = string
end

#storepass=(string) ⇒ Object

The password required to access the keystore. If not specified, ADT

prompts for the password.


41
42
43
# File 'lib/sprout/tasks/adl_documentation.rb', line 41

def storepass=(string)
  @storepass = string
end

#storetype=(string) ⇒ Object

The type of keystore, determined by the keystore implementation. The

default keystore implementation included with most installations of 
Java supports the JKS and PKCS12 types. Java 5.0 includes support for 
the PKCS11 type, for accessing keystores on hardware tokens, and 
Keychain type, for accessing the Mac OS-X keychain. Java 6.0 includes 
support for the MSCAPI type (on Windows). If other JCA providers have 
been installed and configured, additional keystore types might be 
available. If no keystore type is specified, the default type for the 
default JCA provider is used.


24
25
26
# File 'lib/sprout/tasks/adl_documentation.rb', line 24

def storetype=(string)
  @storetype = string
end

#tsa=(url) ⇒ Object

Specifies the URL of an RFC3161-compliant time stamp server to time

stamp the digital signature. If no URL is specified, a default time 
stamp server provided by Geotrust is used. When the signature of an AIR
application is time stamped, the application can still be installed 
after the signing certificate expires, because the time stamp verifies 
that the certificate was valid at the time of signing.


57
58
59
# File 'lib/sprout/tasks/adl_documentation.rb', line 57

def tsa=(url)
  @tsa = url
end