MCPcopy Create free account
hub / github.com/diffplug/goomph / build

Method build

src/main/java/com/diffplug/gradle/pde/PdeBuildTask.java:157–201  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155 }
156
157 @TaskAction
158 public void build() throws Exception {
159 Objects.requireNonNull(destination, "destination must not be null!");
160 Objects.requireNonNull(base, "base must not be null!");
161
162 // delete the buildDir and make a fresh directory
163 File destination = getProject().file(this.destination);
164 FileMisc.cleanDir(destination);
165
166 File base = getProject().file(this.base);
167
168 // setup build.properties
169 PdeBuildProperties properties = new PdeBuildProperties();
170 properties.setBasePlatform(SwtPlatform.getRunning());
171 properties.setBuildDirectory(destination);
172 properties.setProp("base", base.getAbsolutePath());
173 properties.setConfigs(platforms); // for all configs
174 properties.setJDK(config);
175
176 List<File> pluginPaths = FileMisc.parseListFile(getProject(), pluginPath);
177 properties.setPluginPaths(pluginPaths);
178
179 // now that we've set the base values, give the product part a wack at it (if there is one)
180 if (productConfig != null) {
181 PdeProductBuildConfig product = new PdeProductBuildConfig(getProject());
182 productConfig.execute(product);
183 List<File> roots = new ArrayList<>();
184 roots.addAll(pluginPaths);
185 product.setup(destination, properties, platforms, roots);
186 }
187
188 // set all the properties we'd like to set
189 for (Map.Entry<String, String> entry : buildProperties.entrySet()) {
190 properties.setProp(entry.getKey(), entry.getValue());
191 }
192 // write build.properties to the appropriate directory
193 File buildDirProperties = new File(destination, "build.properties");
194 Files.write(properties.getContent(), buildDirProperties, StandardCharsets.UTF_8);
195
196 // generate and execute the PDE build command
197 PdeInstallation installation = PdeInstallation.fromProject(getProject());
198 EclipseApp app = installation.productBuildCmd(destination);
199 appModifier.execute(app);
200 app.runUsing(installation);
201 }
202}

Callers 15

ensureOverrideWorksMethod · 0.45
testCaseMethod · 0.45
assertPluginWorksMethod · 0.45
testCaseMethod · 0.45
testCaseMethod · 0.45
testCaseMethod · 0.45
testMethod · 0.45

Calls 15

cleanDirMethod · 0.95
setBasePlatformMethod · 0.95
setBuildDirectoryMethod · 0.95
setPropMethod · 0.95
setConfigsMethod · 0.95
setJDKMethod · 0.95
parseListFileMethod · 0.95
setPluginPathsMethod · 0.95
setupMethod · 0.95
getContentMethod · 0.95
fromProjectMethod · 0.95
productBuildCmdMethod · 0.95

Tested by 15

ensureOverrideWorksMethod · 0.36
testCaseMethod · 0.36
assertPluginWorksMethod · 0.36
testCaseMethod · 0.36
testCaseMethod · 0.36
testCaseMethod · 0.36
testMethod · 0.36