groocss extension module methods not working
mariogarcia opened this issue · comments
Hi, nice project BTW!:
Problem
I'm using the groocss assets-pipelines plugin in version 4.0.0 and it seems that I can't use measurement methods from the extension module.
At the moment I have to hardcoded the measurements, but if you uncomment the problematic line in this file it will fail:
p {
add '> a.doc_link', {
color '#fff'
// paddingLeft 1.em // <-- fails
paddingLeft '1em'
}
}
How to reproduce
I've created an example project where you can reproduce the behavior by uncomment the aforementioned line at https://github.com/mariogarcia/asset-pipelines-example.
./gradlew assetClean assetCompile
Versions
- JDK11
- Gradle 6.5 (wrapper)
- Assets Pipelines 4.0.0
- When asking for the dependencies of the plugin it seems it is using
org.groocss:groocss:1.0-M1
.
Cheers!
Mario
I've added the groovy plugin to the project with groovy-all as it is suggested in the README. Nothing changed still complaining.
It is still don't working but at least I'm figuring out a little bit more on how dependencies work :
I though marking a Gradle dependency with an assets scope implied that dependency was included in the Gradle's compileClasspath too. But it didn't.
So changing:
assets("com.bertramlabs.plugins:groocss-asset-pipeline:$assets_pipeline")
to this:
compile("com.bertramlabs.plugins:groocss-asset-pipeline:$assets_pipeline")
At least make the compiler happy, but on the other hand the resulting css file looks like assetCompile hasn't processed the groocss code. The css file contains the groocss code unchanged.
And finally, if I added both:
assets("com.bertramlabs.plugins:groocss-asset-pipeline:$assets_pipeline")
compile("com.bertramlabs.plugins:groocss-asset-pipeline:$assets_pipeline")
Makes the compiler to complain again.
I'm chaning strategy. Now I'm excluding current version of Groocss from 1.0-M1 to 1.0-M2 and now everything works. Compilation works and asset processing works as well.
assets('org.groocss:groocss:1.0-M2')
assets("com.bertramlabs.plugins:groocss-asset-pipeline:$assets_pipeline") {
exclude group: "org.groocss", module: "groocss"
}
So it seems to be something broken in Groocss in version 1.0-M1. I'm opening a pull request.
I realized it is also working by bumping the Gradle asset-pipline plugin to version 3.4.4.
plugins {
id 'groovy'
id "com.bertramlabs.asset-pipeline" version "3.4.4"
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
assets "com.bertramlabs.plugins:asset-pipeline-core:4.0.0"
assets "com.bertramlabs.plugins:jsx-asset-pipeline:4.0.0"
assets "com.bertramlabs.plugins:typescript-asset-pipeline:4.0.0"
assets "com.bertramlabs.plugins:groocss-asset-pipeline:4.0.0"
}
assets {
minifyJs = true
minifyCss = true
enableSourceMaps = true
maxThreads = 8
configOptions = [
commonJs: true,
enableES6: false,
groocss: [
prettyPrint: false,
compress: true,
noExts: false,
convertUnderline: false
]
]
excludes = [
'components/*',
'react*.js',
'layout/*',
'custom/*.css',
'*.groocss',
]
}
So it seems that the sweetspot is:
- JDK11
- Gradle 6.5 (wrapper)
- Assets Pipelines 4.0.0
- Gradle Asset Pipelines plugin 3.4.4
Closing this issue