-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ProjectMetaConventions interface
- Loading branch information
Showing
12 changed files
with
39 additions
and
61 deletions.
There are no files selected for viewing
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
10 changes: 1 addition & 9 deletions
10
plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/bukkit/BukkitConvention.kt
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 |
---|---|---|
@@ -1,18 +1,10 @@ | ||
package xyz.jpenilla.resourcefactory.bukkit | ||
|
||
import org.gradle.api.Project | ||
import xyz.jpenilla.resourcefactory.ResourceFactoryConventionPlugin | ||
|
||
abstract class BukkitConvention : ResourceFactoryConventionPlugin<BukkitPluginYml>( | ||
"bukkitPluginYml", | ||
{ project -> project.bukkitPluginYml() }, | ||
"main", | ||
{ factoryExt, ext -> factoryExt.factory(ext.resourceFactory()) } | ||
) { | ||
override fun touchExtension(target: Project, ext: BukkitPluginYml) { | ||
target.afterEvaluate { | ||
// we need to set the conventions again, since the object was created eagerly. | ||
ext.copyProjectMeta(this) | ||
} | ||
} | ||
} | ||
) |
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
10 changes: 1 addition & 9 deletions
10
plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/bungee/BungeeConvention.kt
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 |
---|---|---|
@@ -1,18 +1,10 @@ | ||
package xyz.jpenilla.resourcefactory.bungee | ||
|
||
import org.gradle.api.Project | ||
import xyz.jpenilla.resourcefactory.ResourceFactoryConventionPlugin | ||
|
||
abstract class BungeeConvention : ResourceFactoryConventionPlugin<BungeePluginYml>( | ||
"bungeePluginYml", | ||
{ project -> project.bungeePluginYml() }, | ||
"main", | ||
{ factoryExt, ext -> factoryExt.factory(ext.resourceFactory()) } | ||
) { | ||
override fun touchExtension(target: Project, ext: BungeePluginYml) { | ||
target.afterEvaluate { | ||
// we need to set the conventions again, since the object was created eagerly. | ||
ext.copyProjectMeta(this) | ||
} | ||
} | ||
} | ||
) |
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
10 changes: 1 addition & 9 deletions
10
plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/fabric/FabricConvention.kt
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 |
---|---|---|
@@ -1,18 +1,10 @@ | ||
package xyz.jpenilla.resourcefactory.fabric | ||
|
||
import org.gradle.api.Project | ||
import xyz.jpenilla.resourcefactory.ResourceFactoryConventionPlugin | ||
|
||
abstract class FabricConvention : ResourceFactoryConventionPlugin<FabricModJson>( | ||
"fabricModJson", | ||
{ project -> project.fabricModJson() }, | ||
"main", | ||
{ factoryExt, ext -> factoryExt.factory(ext.resourceFactory()) } | ||
) { | ||
override fun touchExtension(target: Project, ext: FabricModJson) { | ||
target.afterEvaluate { | ||
// we need to set the conventions again, since the object was created eagerly. | ||
ext.copyProjectMeta(this) | ||
} | ||
} | ||
} | ||
) |
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
10 changes: 1 addition & 9 deletions
10
plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/paper/PaperConvention.kt
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 |
---|---|---|
@@ -1,18 +1,10 @@ | ||
package xyz.jpenilla.resourcefactory.paper | ||
|
||
import org.gradle.api.Project | ||
import xyz.jpenilla.resourcefactory.ResourceFactoryConventionPlugin | ||
|
||
abstract class PaperConvention : ResourceFactoryConventionPlugin<PaperPluginYml>( | ||
"paperPluginYml", | ||
{ project -> project.paperPluginYml() }, | ||
"main", | ||
{ factoryExt, ext -> factoryExt.factory(ext.resourceFactory()) } | ||
) { | ||
override fun touchExtension(target: Project, ext: PaperPluginYml) { | ||
target.afterEvaluate { | ||
// we need to set the conventions again, since the object was created eagerly. | ||
ext.copyProjectMeta(this) | ||
} | ||
} | ||
} | ||
) |
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
7 changes: 7 additions & 0 deletions
7
plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/util/ProjectMetaConventions.kt
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,7 @@ | ||
package xyz.jpenilla.resourcefactory.util | ||
|
||
import org.gradle.api.Project | ||
|
||
interface ProjectMetaConventions { | ||
fun setConventionsFromProjectMeta(project: Project) | ||
} |
10 changes: 1 addition & 9 deletions
10
plugin/src/main/kotlin/xyz/jpenilla/resourcefactory/velocity/VelocityConvention.kt
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 |
---|---|---|
@@ -1,18 +1,10 @@ | ||
package xyz.jpenilla.resourcefactory.velocity | ||
|
||
import org.gradle.api.Project | ||
import xyz.jpenilla.resourcefactory.ResourceFactoryConventionPlugin | ||
|
||
abstract class VelocityConvention : ResourceFactoryConventionPlugin<VelocityPluginJson>( | ||
"velocityPluginJson", | ||
{ project -> project.velocityPluginJson() }, | ||
"main", | ||
{ factoryExt, ext -> factoryExt.factory(ext.resourceFactory()) } | ||
) { | ||
override fun touchExtension(target: Project, ext: VelocityPluginJson) { | ||
target.afterEvaluate { | ||
// we need to set the conventions again, since the object was created eagerly. | ||
ext.copyProjectMeta(this) | ||
} | ||
} | ||
} | ||
) |
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