View Javadoc

1   /*
2    * Copyright 2011 SOFTEC sa. All rights reserved.
3    *
4    * This source code is licensed under the Creative Commons
5    * Attribution-NonCommercial-NoDerivs 3.0 Luxembourg
6    * License.
7    *
8    * To view a copy of this license, visit
9    * http://creativecommons.org/licenses/by-nc-nd/3.0/lu/
10   * or send a letter to Creative Commons, 171 Second Street,
11   * Suite 300, San Francisco, California, 94105, USA.
12   */
13  
14  package org.codehaus.mojo.javascript;
15  
16  /**
17   * Represent a Virtual Device configuration.
18   * Used by {@link TitaniumPackageMojo} when executeMode is virtual
19   * to retrieve the emulator settings.
20   */
21  public class VirtualDevice {
22  
23      /**
24       * <p>The version on which the virtual device should run.</p>
25       * <p>If not specified, the latest android API version will be used.
26       * Regardless of the global androidAPI value.</p>
27       * @parameter expression="${virtualDevice.androidAPI}"
28       */
29      private String androidAPI;
30  
31      /**
32       * <p>The ios version of the virtual device.</p>
33       * <p>If not specified the latest available version will be used.
34       * Regardless of the global parameter value</p>
35       *
36       * @parameter expression="${virtualDevice.iosVersion}"
37       */
38      private String iosVersion;
39  
40      /**
41       * The skin of the android emulator.
42       * Defaults to HVGA for version less than 10 and to WXGA for version greater than 10
43       * @parameter expression="${virtualDevice.skin}"
44       */
45      private String skin;
46  
47      /**
48       * The iOS device family.
49       * valid values are iphone or ipad.
50       * @parameter default-value="iphone" expression="${virtualDevice.family}"
51       */
52      private String family;
53  
54      /**
55       * How much miliseconds to wait after launching emulator before
56       * installing the android application.
57       * @parameter default-value="30" expression="${virtualDevice.wait}"
58       */
59      private Long wait;
60  
61      /**
62       * Retrieve the virtual device family for the iphone/ipad/universal platform.
63       * @return The virtual device family.
64       * If not set, "iphone" will be returned.
65       */
66      public String getFamily() {
67          if (family == null) {
68              family = "iphone";
69          }
70          return family;
71      }
72  
73      /**
74       * Set the virtual device family of the iphone emulator.
75       * @param family The virtual device family.
76       * <p>Accepted values are:</p>
77       * <ul>
78       *     <li>iphone</li>
79       *     <li>ipad</li>
80       * </ul>
81       */
82      public void setFamily(String family) {
83          this.family = family;
84      }
85  
86      /**
87       * Retrieve the skin of the android virtual device.
88       * @return The skin of the android virtual device.
89       */
90      public String getSkin() {
91          return skin;
92      }
93  
94      /**
95       * Set the skin of the android virtual device.
96       * @param skin The skin of the android virtual device.
97       */
98      public void setSkin(String skin) {
99          this.skin = skin;
100     }
101 
102     /**
103      * Retrieve the android API version.
104      * @return The android API version.
105      */
106     public String getAndroidAPI() {
107         return androidAPI;
108     }
109 
110     /**
111      * Set the android API version.
112      * @param androidAPI The android API version.
113      */
114     public void setAndroidAPI(String androidAPI) {
115         this.androidAPI = androidAPI;
116     }
117 
118     /**
119      * Retrieve the wait time between the android emulator and simulator launch.
120      * @return The wait time.
121      */
122     public Long getWait() {
123         return wait;
124     }
125 
126     /**
127      * Set the wait time before launching the simulator after having launched the
128      * android simulator.
129      * @param wait The wait time.
130      */
131     public void setWait(Long wait) {
132         this.wait = wait;
133     }
134 
135     /**
136      * Retrieve the iOS version.
137      * @return The iOS version.
138      */
139     public String getIosVersion() {
140         return iosVersion;
141     }
142 
143     /**
144      * Set the iOS version.
145      * @param iosVersion The iOS version.
146      */
147     public void setIosVersion(String iosVersion) {
148         this.iosVersion = iosVersion;
149     }
150 }