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. http://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 = "    The alias of a key in the keystore. Specifying an alias is not \n    necessary when a keystore only contains a single certificate. If no \n    alias is specified, ADT uses the first key in the keystore.\n    DESC\n  end\n  \n  add_param(:storetype, :string) do |p|\n    p.delimiter = \" \"\n    p.description = <<-DESC\n    The type of keystore, determined by the keystore implementation. The \n    default keystore implementation included with most installations of \n    Java supports the JKS and PKCS12 types. Java 5.0 includes support for \n    the PKCS11 type, for accessing keystores on hardware tokens, and \n    Keychain type, for accessing the Mac OS-X keychain. Java 6.0 includes \n    support for the MSCAPI type (on Windows). If other JCA providers have \n    been installed and configured, additional keystore types might be \n    available. If no keystore type is specified, the default type for the \n    default JCA provider is used.\n    DESC\n  end\n  \n  add_param(:providerName, :string) do |p|\n    p.delimiter = \" \"\n    p.description = <<-DESC\n    The JCA provider for the specified keystore type. If not specified, \n    then ADT uses the default provider for that type of keystore.\n    DESC\n  end      \n  \n  add_param(:keystore, :file) do |p|\n    p.delimiter = \" \"\n    p.description = \"The path to the keystore file for file-based store types.\"\n  end\n  \n  add_param(:storepass, :string) do |p|\n    p.delimiter = \" \"\n    p.description = <<-DESC\n    The password required to access the keystore. If not specified, ADT \n    prompts for the password.\n    DESC\n  end\n  \n  add_param(:keypass, :string) do |p|\n    p.delimiter = \" \"\n    p.description = <<-DESC\n    The password required to access the private key that will be used to \n    sign the AIR application. If not specified, ADT prompts for the password.\n    DESC\n  end\n  \n  add_param(:tsa, :url) do |p|\n    p.delimiter = \" \"\n    p.description = <<-DESC\n    Specifies the URL of an RFC3161-compliant time stamp server to time \n    stamp the digital signature. If no URL is specified, a default time \n    stamp server provided by Geotrust is used. When the signature of an AIR\n    application is time stamped, the application can still be installed \n    after the signing certificate expires, because the time stamp verifies \n    that the certificate was valid at the time of signing. \n    DESC\n  end\n  \n  #\n  # ADT package options\n  #\n\n  add_param(:output, :file) do |p|\n    p.hidden_name = true\n    p.required = true\n    p.description = \"The name of the AIR file to be created.\"\n  end\n  \n  add_param(:application_descriptor, :file) do |p|\n    p.hidden_name = true\n    p.delimiter = \" \"\n    p.required = true\n    p.description = <<-DESC\n    The path to the application descriptor file. The path can be specified \n    relative to the current directory or as an absolute path. (The \n    application descriptor file is renamed as \"application.xml\" in the AIR \n    file.)\n    DESC\n  end\n\n  add_param(:files, :files) do |p|\n    # Work-around for shell name not being hidden on files param type\n    p.instance_variable_set(:@shell_name, \"\")        \n    p.hidden_name = true\n    p.delimiter = \"\"        \n    p.description = <<-DESC\n    The files and directories to package in the AIR file. Any number of \n    files and directories can be specified, delimited by whitespace. If you\n    list a directory, all files and subdirectories within, except hidden \n    files, are added to the package. (In addition, if the application \n    descriptor file is specified, either directly, or through wildcard or \n    directory expansion, it is ignored and not added to the package a \n    second time.) Files and directories specified must be in the current \n    directory or one of its subdirectories. Use the -C option to change the \n    current directory.\n    DESC\n  end\n\n  def define # :nodoc:\n    super\n\n    if(!output)\n      self.output = name\n    end\n\n    CLEAN.add(output)\n  end\n        \nend\n"

#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