bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
193 stars 91 forks source link

Can't add custom *AssetFile.groovy #254

Closed webmustang closed 4 years ago

webmustang commented 4 years ago

Can't add custom *AssetFile.groovy in my project. It works with bootRun but doesn't work with assetCompile

According to doc I created file src/main/resources/META-INF/asset-pipeline/asset.specs

Simply adding a list file META-INF/asset-pipeline/asset.specs to the classpath will automatically get scanned.

As I understand it should be automatically added to classpath. I tried to add asset.specs to classpath manually, but nothing happened.

It seems that asset.specs doesn't added to classpath when run assetCompile.

When added breakpoint at asset-pipeline-core-3.0.11-sources.jar!/asset/pipeline/AssetSpecLoader.groovy:56 file asset.specs from project doesn't persists.

Demo project is here: https://github.com/webmustang/grails-demo/tree/asset-issue-demo

Changes from clean grails 3.3.11 are here: https://github.com/webmustang/grails-demo/pull/1/files

How can I fix this?

Thanks.

davydotcom commented 4 years ago

your custom asset file needs to be in a library that can be included not just in application runtime but also your build class path