-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting of module SDK (introducing module settings) (#19)
Allow setting of module SDK (introducing module settings)
- Loading branch information
Showing
26 changed files
with
880 additions
and
287 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 0 additions & 96 deletions
96
src/main/java/de/gebit/plugins/autoconfig/ConfigurationLoaderService.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/de/gebit/plugins/autoconfig/UpdateModuleHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package de.gebit.plugins.autoconfig; | ||
|
||
|
||
import com.intellij.openapi.module.Module; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Extension point for used to supply module configuration update handlers. | ||
*/ | ||
public interface UpdateModuleHandler<T> extends UpdateSettings<T> { | ||
|
||
/** | ||
* Implementing handlers should carefully select the modules in which to apply any settings changes. | ||
* | ||
* @param configuration the configuration object used for this update handler | ||
* @param module module to accept or deny | ||
* @return whether the given module should be accepted for this module handler, default is {@code false} (no changes | ||
* will be applied) | ||
*/ | ||
default boolean acceptModule(T configuration, Module module) { | ||
return false; | ||
} | ||
|
||
/** | ||
* The implementation of the configuration updates. A configuration update object is supplied containing the | ||
* information gathered from the yaml file. | ||
* | ||
* @param configuration the configuration object used for this update handler | ||
* @param module the module that will receive the configuration updates in case they can be applied | ||
* @return list of configuration parts that have been updated | ||
*/ | ||
List<String> updateConfiguration(T configuration, Module module); | ||
|
||
@Override | ||
default UpdateTarget getUpdateTarget() { | ||
return UpdateTarget.MODULE; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/de/gebit/plugins/autoconfig/UpdateSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package de.gebit.plugins.autoconfig; | ||
|
||
|
||
/** | ||
* Common interface for update handlers. Meta information about the handler is returned from the given methods. | ||
*/ | ||
public interface UpdateSettings<T> { | ||
/** | ||
* Provide the file name that is expected to contain the extensions' configuration. | ||
* | ||
* @return the file name that is expected to contain the extensions' configuration | ||
*/ | ||
String getFileName(); | ||
|
||
/** | ||
* The json schema containing/providing the information on how to write the configuration file. | ||
* | ||
* @return json schema containing/providing the information on how to write the configuration file | ||
*/ | ||
String getJsonSchema(); | ||
|
||
/** | ||
* The updater name is used for logging purposes and as a name for the json schema displayed in IntelliJ status | ||
* bar. | ||
* | ||
* @return the name of this updater | ||
*/ | ||
String getUpdaterName(); | ||
|
||
/** | ||
* The configuration object class used to read/deserialize the configuration file. | ||
* | ||
* @return configuration object class used to read/deserialize the configuration file | ||
*/ | ||
Class<T> getConfigurationClass(); | ||
|
||
/** | ||
* Specifies, whether modules or projects are target for this handler object. | ||
* | ||
* @return whether modules or projects are target for this handler object | ||
*/ | ||
UpdateTarget getUpdateTarget(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package de.gebit.plugins.autoconfig; | ||
|
||
|
||
/** | ||
* Specifies, whether projects or modules are target of configuration updates. | ||
*/ | ||
public enum UpdateTarget { | ||
PROJECT, MODULE | ||
} |
Oops, something went wrong.