src/share/classes/com/sun/tools/javac/sym/Profiles.java

changeset 1636
82dc1e827c2a
parent 1569
475eb15dfdad
child 1971
57e1266527dd
equal deleted inserted replaced
1635:e0ef84e33167 1636:82dc1e827c2a
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() {

mercurial