147 pkg.getPackages(profile, results); |
147 pkg.getPackages(profile, results); |
148 } |
148 } |
149 } |
149 } |
150 |
150 |
151 final static Map<String, Package> packages = new TreeMap<String, Package>(); |
151 final static Map<String, Package> packages = new TreeMap<String, Package>(); |
152 int maxProfile; |
152 |
|
153 final int maxProfile = 4; // Three compact profiles plus full JRE |
153 |
154 |
154 MakefileProfiles(Properties p) { |
155 MakefileProfiles(Properties p) { |
155 int profile = 1; |
156 for (int profile = 1; profile <= maxProfile; profile++) { |
156 while (true) { |
157 String prefix = (profile < maxProfile ? "PROFILE_" + profile : "FULL_JRE"); |
157 String inclPackages = p.getProperty("PROFILE_" + profile + "_RTJAR_INCLUDE_PACKAGES"); |
158 String inclPackages = p.getProperty(prefix + "_RTJAR_INCLUDE_PACKAGES"); |
158 if (inclPackages == null) |
159 if (inclPackages == null) |
159 break; |
160 break; |
160 for (String pkg: inclPackages.substring(1).trim().split("\\s+")) { |
161 for (String pkg: inclPackages.substring(1).trim().split("\\s+")) { |
161 if (pkg.endsWith("/")) |
162 if (pkg.endsWith("/")) |
162 pkg = pkg.substring(0, pkg.length() - 1); |
163 pkg = pkg.substring(0, pkg.length() - 1); |
163 includePackage(profile, pkg); |
164 includePackage(profile, pkg); |
164 } |
165 } |
165 String inclTypes = p.getProperty("PROFILE_" + profile + "_RTJAR_INCLUDE_TYPES"); |
166 String inclTypes = p.getProperty(prefix + "_RTJAR_INCLUDE_TYPES"); |
166 if (inclTypes != null) { |
167 if (inclTypes != null) { |
167 for (String type: inclTypes.replace("$$", "$").split("\\s+")) { |
168 for (String type: inclTypes.replace("$$", "$").split("\\s+")) { |
168 if (type.endsWith(".class")) |
169 if (type.endsWith(".class")) |
169 includeType(profile, type.substring(0, type.length() - 6)); |
170 includeType(profile, type.substring(0, type.length() - 6)); |
170 } |
171 } |
171 } |
172 } |
172 String exclTypes = p.getProperty("PROFILE_" + profile + "_RTJAR_EXCLUDE_TYPES"); |
173 String exclTypes = p.getProperty(prefix + "_RTJAR_EXCLUDE_TYPES"); |
173 if (exclTypes != null) { |
174 if (exclTypes != null) { |
174 for (String type: exclTypes.replace("$$", "$").split("\\s+")) { |
175 for (String type: exclTypes.replace("$$", "$").split("\\s+")) { |
175 if (type.endsWith(".class")) |
176 if (type.endsWith(".class")) |
176 excludeType(profile, type.substring(0, type.length() - 6)); |
177 excludeType(profile, type.substring(0, type.length() - 6)); |
177 } |
178 } |
178 } |
179 } |
179 maxProfile = profile; |
|
180 profile++; |
|
181 } |
180 } |
182 } |
181 } |
183 |
182 |
184 @Override |
183 @Override |
185 public int getProfileCount() { |
184 public int getProfileCount() { |