bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
194 stars 92 forks source link

Unable to configure cacheLocation #213

Closed dlehammer closed 6 years ago

dlehammer commented 6 years ago

Symptom

Grails v3.3.5 auto-generated web-app generates .asscache in the root dir, as described in Place the default cache file in target folder of grails #301 it would be sensible to encapsulate auto-generated artifacts inside the build-directory by default.

Grails v3.3.5 utilizes

"com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8"

I've been unable to configure cacheLocation ex. build.gradle attempt

...
assets {
    cacheLocation = "$buildDir/.asscache"
    minifyJs = true
    minifyCss = true
}
...

Results in

...
FAILURE: Build failed with an exception.

* Where:
Build file '/home/dleh/work/project/erst/upgrade_grails3/le-dirigent/build.gradle' line: 112

* What went wrong:
A problem occurred evaluating root project 'dirigent'.
> Could not set unknown property 'cacheLocation' for object of type asset.pipeline.gradle.AssetPipelineExtension.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
...

Proposed solution

Perhaps the solution is adding a cacheLocation configuration example in the documentation.

For now I've added .asscache to .gitignore #bandaid

davydotcom commented 6 years ago

Hmmm, the asset-pipeline-grails plugin is supposed to be changing this on startup… Ill check into it..

On Jul 13, 2018, at 6:06 AM, dlehammer notifications@github.com wrote:

Symptom

Grails v3.3.5 auto-generated web-app generates .asscache in the root dir, as described in Place the default cache file in target folder of grails #301 https://github.com/bertramdev/grails-asset-pipeline/issues/301 it would be sensible to encapsulate auto-generated artifacts inside the build-directory by default.

Grails v3.3.5 utilizes

"com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8"

I've been unable to configure cacheLocation ex. build.gradle attempt

... assets { cacheLocation = "$buildDir/.asscache" minifyJs = true minifyCss = true } ... Results in

... FAILURE: Build failed with an exception.

  • Where: Build file '/home/dleh/work/project/erst/upgrade_grails3/le-dirigent/build.gradle' line: 112

  • What went wrong: A problem occurred evaluating root project 'dirigent'.

    Could not set unknown property 'cacheLocation' for object of type asset.pipeline.gradle.AssetPipelineExtension.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED ... Proposed solution

Perhaps the solution is adding a cacheLocation configuration example in the documentation http://www.asset-pipeline.com/manual/#configuration.

For now I've added .asscache to .gitignore #bandaid

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bertramdev/asset-pipeline/issues/213, or mute the thread https://github.com/notifications/unsubscribe-auth/AABaEjDl_9CJzHfaqD5KH3gdKpq42FSBks5uGHEjgaJpZM4VOov7.

davydotcom commented 6 years ago

this can be done actually via configOptions ... but adding it as part of standard detection for grails/gradle

davydotcom commented 6 years ago
assets {
configOptions = [cacheLocation: "${buildDir}/.asscache"]
}
dlehammer commented 6 years ago

@davydotcom thank you for the work-around, it works as advertised :) (tested on v2.14.2 & 2.14.8)

Hmmm, the asset-pipeline-grails plugin is supposed to be changing this on startup… Ill check into it..

The described symptom is with asset-pipeline-grails included, with matching version. (asset-pipeline-grails is included by Grails 3 by default for web-app & web-plugin)