Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For WEB_PLUGIN set packagePlugin prop #199

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void apply(GeneratorContext generatorContext) {
.buildscript());
generatorContext.addBuildPlugin(GradlePlugin.builder()
.id("com.bertramlabs.asset-pipeline")
.extension(new RockerWritable(assetPipelineExtension.template()))
.extension(new RockerWritable(assetPipelineExtension.template(generatorContext.getApplicationType())))
.build());

generatorContext.addDependency(Dependency.builder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
@import org.grails.forge.application.ApplicationType

@args (
org.grails.forge.application.ApplicationType applicationType
)

assets {
@if (applicationType == ApplicationType.WEB_PLUGIN) {
packagePlugin = true
}
minifyJs = true
minifyCss = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ assets {
}''')
}

void "test extension packagePlugin is set for application #applicationType"() {
when:
final String template = new BuildBuilder(beanContext)
.applicationType(applicationType)
.features(["asset-pipeline-grails"])
.render()

then:
template.contains('''
assets {
packagePlugin = true
minifyJs = true
minifyCss = true
}''')
where:
applicationType << [ApplicationType.WEB_PLUGIN]
}

void "test assets files are present"() {
given:
final Map<String, String> output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11))
Expand Down