mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
build scripts: added method to compile modules for product
(cherry picked from commit 63c2372, IDEA-CR-16653)
This commit is contained in:
@@ -44,6 +44,8 @@ abstract class BuildTasks {
|
||||
*/
|
||||
abstract void buildDistributions()
|
||||
|
||||
abstract void compileModules()
|
||||
|
||||
abstract void compileProjectAndTests(List<String> includingTestsInModules)
|
||||
|
||||
abstract void compileModules(List<String> moduleNames, List<String> includingTestsInModules = [])
|
||||
@@ -63,18 +65,36 @@ abstract class BuildTasks {
|
||||
* @param groovyRootRelativePaths paths to root folders containing {@code productPropertiesClassName} and required classes, relative to project home
|
||||
* @param communityHomeRelativePath path to a directory containing sources from idea/community Git repository relative to project home
|
||||
*/
|
||||
@CompileDynamic
|
||||
static void buildProduct(String productPropertiesClassName, List<String> groovyRootRelativePaths, String communityHomeRelativePath, Script gantScript,
|
||||
static void buildProduct(String productPropertiesClassName, List<String> groovyRootRelativePaths,
|
||||
String communityHomeRelativePath, Script gantScript,
|
||||
ProprietaryBuildTools proprietaryBuildTools = ProprietaryBuildTools.DUMMY) {
|
||||
BuildContext context = createBuildContextFromProduct(productPropertiesClassName, groovyRootRelativePaths,
|
||||
communityHomeRelativePath, gantScript, proprietaryBuildTools)
|
||||
create(context).buildDistributions()
|
||||
}
|
||||
|
||||
static void compileModulesFromProduct(String productPropertiesClassName, List<String> groovyRootRelativePaths,
|
||||
String communityHomeRelativePath, Script gantScript,
|
||||
ProprietaryBuildTools proprietaryBuildTools = ProprietaryBuildTools.DUMMY) {
|
||||
BuildContext context = createBuildContextFromProduct(productPropertiesClassName, groovyRootRelativePaths,
|
||||
communityHomeRelativePath, gantScript, proprietaryBuildTools)
|
||||
|
||||
create(context).compileModules()
|
||||
}
|
||||
|
||||
@CompileDynamic
|
||||
static BuildContext createBuildContextFromProduct(String productPropertiesClassName, List<String> groovyRootRelativePaths,
|
||||
String communityHomeRelativePath, Script gantScript,
|
||||
ProprietaryBuildTools proprietaryBuildTools = ProprietaryBuildTools.DUMMY) {
|
||||
String projectHome = IdeaProjectLoader.guessHome(gantScript)
|
||||
GantBinding binding = (GantBinding)gantScript.binding
|
||||
GantBinding binding = (GantBinding) gantScript.binding
|
||||
groovyRootRelativePaths.each {
|
||||
BuildUtils.addToClassPath("$projectHome/$it", binding.ant)
|
||||
}
|
||||
binding.includeTool << JpsGantTool
|
||||
ProductProperties productProperties = (ProductProperties) Class.forName(productPropertiesClassName).constructors[0].newInstance(projectHome)
|
||||
def context = BuildContext.createContext(binding.ant, binding.projectBuilder, binding.project, binding.global,
|
||||
"$projectHome/$communityHomeRelativePath", projectHome, productProperties, proprietaryBuildTools)
|
||||
create(context).buildDistributions()
|
||||
BuildContext context = BuildContext.createContext(binding.ant, binding.projectBuilder, binding.project, binding.global,
|
||||
"$projectHome/$communityHomeRelativePath", projectHome, productProperties, proprietaryBuildTools)
|
||||
return context
|
||||
}
|
||||
}
|
||||
@@ -239,6 +239,15 @@ idea.fatal.error.notification=disabled
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void compileModules() {
|
||||
checkProductProperties()
|
||||
def patchedApplicationInfo = patchApplicationInfo()
|
||||
def distributionJARsBuilder = new DistributionJARsBuilder(buildContext, patchedApplicationInfo)
|
||||
compileModules(buildContext.productProperties.productLayout.includedPluginModules + distributionJARsBuilder.platformModules +
|
||||
buildContext.productProperties.additionalModulesToCompile, buildContext.productProperties.modulesToCompileTests)
|
||||
}
|
||||
|
||||
@Override
|
||||
void buildDistributions() {
|
||||
checkProductProperties()
|
||||
|
||||
Reference in New Issue
Block a user