Build: Make idea/eclipse project generation build generated resources for plugins
This adds a generated-resources dir that the plugin properties are generated into. This must be outside of the build dir, since intellij has build as "excluded". closes #14392
This commit is contained in:
parent
5104365a92
commit
b7f8e5c1df
|
@ -8,6 +8,7 @@ work/
|
|||
logs/
|
||||
.DS_Store
|
||||
build/
|
||||
generated-resources/
|
||||
**/.local*
|
||||
docs/html/
|
||||
docs/build.log
|
||||
|
|
|
@ -153,7 +153,7 @@ allprojects {
|
|||
apply plugin: 'idea'
|
||||
}
|
||||
|
||||
if (hasProperty('projectsPrefix') == false) {
|
||||
if (projectsPrefix.isEmpty()) {
|
||||
idea {
|
||||
project {
|
||||
languageLevel = sourceCompatibility
|
||||
|
|
|
@ -84,9 +84,11 @@ class PluginBuildPlugin extends BuildPlugin {
|
|||
static Task configureBundleTask(Project project) {
|
||||
PluginPropertiesTask buildProperties = project.tasks.create(name: 'pluginProperties', type: PluginPropertiesTask)
|
||||
File pluginMetadata = project.file("src/main/plugin-metadata")
|
||||
project.processTestResources {
|
||||
from buildProperties
|
||||
from pluginMetadata
|
||||
project.sourceSets.test {
|
||||
output.dir(buildProperties.propertiesFile.parentFile, builtBy: 'pluginProperties')
|
||||
resources {
|
||||
srcDir pluginMetadata
|
||||
}
|
||||
}
|
||||
Task bundle = project.tasks.create(name: 'bundlePlugin', type: Zip, dependsOn: [project.jar, buildProperties])
|
||||
bundle.configure {
|
||||
|
|
|
@ -33,9 +33,13 @@ class PluginPropertiesTask extends DefaultTask {
|
|||
|
||||
PluginPropertiesExtension extension
|
||||
Map<String, String> properties = new HashMap<>()
|
||||
File generatedResourcesDir = new File(project.projectDir, "generated-resources")
|
||||
|
||||
PluginPropertiesTask() {
|
||||
extension = project.extensions.create('esplugin', PluginPropertiesExtension, project)
|
||||
project.clean {
|
||||
delete generatedResourcesDir
|
||||
}
|
||||
project.afterEvaluate {
|
||||
if (extension.description == null) {
|
||||
throw new InvalidUserDataException('description is a required setting for esplugin')
|
||||
|
@ -54,7 +58,7 @@ class PluginPropertiesTask extends DefaultTask {
|
|||
}
|
||||
|
||||
@OutputFile
|
||||
File propertiesFile = new File(project.buildDir, "plugin" + File.separator + "plugin-descriptor.properties")
|
||||
File propertiesFile = new File(generatedResourcesDir, "plugin-descriptor.properties")
|
||||
|
||||
void fillProperties() {
|
||||
// TODO: need to copy the templated plugin-descriptor with a dependent task, since copy requires a file (not uri)
|
||||
|
|
Loading…
Reference in New Issue