About Eric Wendelin
eriwen / gradle-css-plugin Goto Github PK
View Code? Open in Web Editor NEWGradle plugin for working with CSS
Home Page: http://eriwen.github.com/gradle-css-plugin
License: Apache License 2.0
Gradle plugin for working with CSS
Home Page: http://eriwen.github.com/gradle-css-plugin
License: Apache License 2.0
Hello,
when I try to minify my style.css and also bootstrap.css and font-awesome.css to one file with the Console command "./gradlew minifyCss " I get the following error:
:combineCss UP-TO-DATE
:minifyCss FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':minifyCss'.
> String index out of range: 391949
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.63 secs
combine all css to one file works. Just to minify them not.(look line one above form console output)
After upgrading to Gradle 1.8 (from Gradle 1.7) our build fails with the following message:
Could not create an instance of type com.eriwen.gradle.js.JavaScriptExtension_Decorated
It appears this plugin supports rendering LESS files, but I can't figure out how to do this. Some examples in the README would be useful.
Thanks for the great plugin.
I use gradle1.3
Could not create an instance of type com.eriwen.gradle.css.CssExtension_Decorated.
thanks!
The plugin adds Maven Central to the project's repositories:
https://github.com/eriwen/gradle-css-plugin/blob/master/src/main/groovy/com/eriwen/gradle/css/CssPlugin.groovy#L60
I believe it is not the plugin's responsibility to change my project's dependencies. Whilst Maven Central is somewhat like a default repository, but it may be desirable to proxy it through a local mirror.
This worked in all versions prior 2.11 and before, but seems that 2.12 breaks something.
Using version:
id "com.eriwen.gradle.css" version "1.11.1"
Could not create an instance of type com.eriwen.gradle.css.source.internal.DefaultCssSourceSet_Decorated.
css.source { allfiles { css { srcDir "src/main/webapp/css/stylesheets/" include "*.css" exclude "*.min.css" } } }
The quick start example on the front page (https://github.com/eriwen/gradle-css-plugin) doesn't work. According to maven search, no versions after 1.11.1 are in the central repository (see http://search.maven.org/#search|gav|1|g%3A%22com.eriwen%22%20AND%20a%3A%22gradle-css-plugin%22)
BUILD FAILED
Total time: 2.264 secs
Could not find com.eriwen:gradle-css-plugin:2.14.0.
Searched in the following locations:
file:/Users/gus/.m2/repository/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.pom
file:/Users/gus/.m2/repository/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.jar
https://repo1.maven.org/maven2/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.pom
https://repo1.maven.org/maven2/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.jar
http://dl.bintray.com/robfletcher/gradle-plugins/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.pom
http://dl.bintray.com/robfletcher/gradle-plugins/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.jar
https://jcenter.bintray.com/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.pom
https://jcenter.bintray.com/com/eriwen/gradle-css-plugin/2.14.0/gradle-css-plugin-2.14.0.jar
When I got plugin with gradle 1.11, gradle thrown error below:
15:12:16.750 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.internal.reflect.ObjectInstantiationException: Could not create an instance of type com.eriwen.gradle.css.CssExtension_Decorated.
15:12:16.750 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:41)
15:12:16.751 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
15:12:16.751 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultConvention.create(DefaultConvention.java:112)
15:12:16.751 [ERROR] [org.gradle.BuildExceptionReporter] at com.eriwen.gradle.css.CssPlugin.apply(CssPlugin.groovy:25)
15:12:16.752 [ERROR] [org.gradle.BuildExceptionReporter] at com.eriwen.gradle.css.CssPlugin.apply(CssPlugin.groovy)
15:12:16.752 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.providePlugin(DefaultPluginContainer.java:104)
15:12:16.753 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.addPluginInternal(DefaultPluginContainer.java:68)
15:12:16.753 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:34)
15:12:16.753 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
15:12:16.780 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
15:12:16.781 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
15:12:16.781 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
15:12:16.782 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:39)
15:12:16.782 [ERROR] [org.gradle.BuildExceptionReporter] at build_2h6eaq0d1gfvspadcnkguaqs5n$_run_closure8.doCall(/home/divinespear/Documents/workspace/innocean-scm/build.gradle:172)
15:12:16.783 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:58)
15:12:16.783 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
15:12:16.784 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
15:12:16.784 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:907)
15:12:16.785 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:912)
15:12:16.785 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:225)
15:12:16.786 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:129)
15:12:16.786 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
15:12:16.787 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
15:12:16.787 [ERROR] [org.gradle.BuildExceptionReporter] at build_2h6eaq0d1gfvspadcnkguaqs5n.run(/home/divinespear/Documents/workspace/innocean-scm/build.gradle:171)
15:12:16.788 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
15:12:16.788 [ERROR] [org.gradle.BuildExceptionReporter] ... 33 more
15:12:16.789 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoSuchMethodError: org.gradle.api.internal.project.ProjectInternal.getServices()Lorg/gradle/internal/service/scopes/ServiceRegistryFactory;
15:12:16.789 [ERROR] [org.gradle.BuildExceptionReporter] at com.eriwen.gradle.css.source.internal.InternalGradle.toInstantiator(InternalGradle.java:14)
15:12:16.790 [ERROR] [org.gradle.BuildExceptionReporter] at com.eriwen.gradle.css.source.internal.InternalGradle$toInstantiator.call(Unknown Source)
15:12:16.790 [ERROR] [org.gradle.BuildExceptionReporter] at com.eriwen.gradle.css.CssExtension.<init>(CssExtension.groovy:16)
15:12:16.790 [ERROR] [org.gradle.BuildExceptionReporter] at com.eriwen.gradle.css.CssExtension_Decorated.<init>(Unknown Source)
15:12:16.791 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:39)
15:12:16.792 [ERROR] [org.gradle.BuildExceptionReporter] ... 57 more
it looks affection by internal api change from gradle 1.11, and should releated with eriwen/gradle-js-plugin#81
I googled same issue from michel-kraemer/gradle-download-task#3, it looks resolved.
After checking csslint using the plugin there are more warnings than using site
http://csslint.net
I suppose there is due to using of not the last version of csslint please update it
I'm using gradle-css-plugin
1.8.2 and Gradle 1.8.
Twitter Bootstrap uses a single bootstrap.less
file which uses @import
to include all sub-components. I am therefore using the plugin as so:
css.source {
less {
css {
srcDir "src/main/webapp/bootstrap/less"
include "bootstrap.less"
}
}
}
However, this results in the following error when running the lesscss
task:
> Less compilation error at src/main/webapp/bootstrap/less/bootstrap.less:0
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "toCSS" of undefined (file:/Users/matt/.gradle/caches/artifacts-26/filestore/com.asual.lesscss/lesscss-engine/1.3.0/jar/901d3011fa670f9e90bd4f83994bf81d1b0f067d/lesscss-engine-1.3.0.jar!/META-INF/engine.js#67)
FWIW, the other gradle less plugin at https://github.com/obecker/gradle-lesscss-plugin works fine using this approach. However, I'd really like all of the other features provided by gradle-css-plugin
so am loathe to switch. This is using Bootstrap 2.3.2.
How to specify multiple source directories? I'd like to do something like that:
// Declare your sources
css.source {
dev {
css {
srcDir 'modules/users/css', 'modules/core/css'
include '*.css'
exclude '*.min.css'
}
}
}
If you try to use the plugin with Gradle 6 just by declaring it in the plugin block it will not work.
The change is actually fixed in master but without a release everyone is forced to manually build the plugin by himself and import the jar the classpath.
It's been a very long time since the latest release however I see commits are happening.
Whether I add my inputs as file, files, or a fileTree, I end up crashing when I try to run the css task.
Here's the simplest example:
css {
inputs.file file("${webAppDir}/myapp/styles/Master.css")
outputs.file file("${buildDir}/myapp-prod-min.css.gzip")
}
When I run the css task, it crashes and I get:
Execution failed for task ':MyProject-Web:css'.
Cause: C:\biglongpathtowebprojectremoved\src\main\webapp\myapp\styles\Master.css is not a directory.
Stack trace:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':MyProject-Web:css'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:71)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:48)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:243)
at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70)
at org.gradle.execution.DefaultBuildExecuter.access$300(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:80)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:233)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:217)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:124)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:53)
Caused by: : C:\biglongpathtowebprojectremoved\src\main\webapp\myapp\styles\Master.css is not a directory.
at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:488)
at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
at org.apache.tools.ant.types.resources.Resources$MyCollection$MyIterator.hasNext(Resources.java:97)
at org.apache.tools.ant.util.CollectionUtils.asCollection(CollectionUtils.java:218)
at org.apache.tools.ant.types.resources.Resources$MyCollection.getCache(Resources.java:83)
at org.apache.tools.ant.types.resources.Resources$MyCollection.iterator(Resources.java:78)
at org.apache.tools.ant.types.resources.Resources.iterator(Resources.java:170)
at org.apache.tools.ant.types.resources.Intersect.collect(Intersect.java:58)
at org.apache.tools.ant.types.resources.Intersect.getCollection(Intersect.java:49)
at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:265)
at org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.size(BaseResourceCollectionContainer.java:154)
at org.apache.tools.ant.taskdefs.Concat.getResources(Concat.java:888)
at org.apache.tools.ant.taskdefs.Concat.execute(Concat.java:781)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:71)
at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:86)
at org.gradle.api.internal.project.DefaultAntBuilder.super$3$invokeMethod(DefaultAntBuilder.groovy)
at org.gradle.api.internal.project.DefaultAntBuilder.invokeMethod(DefaultAntBuilder.groovy:37)
at com.eriwen.gradle.css.tasks.CssTask.run(CssTask.groovy:40)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
at com.eriwen.gradle.css.tasks.CssTask_Decorated.invokeMethod(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:129)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:127)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:63)
... 40 more
Could you start supporting the css doc tool KSS https://github.com/kneath/kss
Hi,
I get an error when trying to run gradle:
FAILURE: Build failed with an exception.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.eriwen:gradle-css-plugin:1.8.1.
Required by:
:townflix.com:unspecified
I just copied the script as it is provided in main page.
Can it be some compatibility issue with gradle 1.11 (it's the version I'm using)
p.s.: is this plugin and the js minify plugin still mantained?
It would by nice to have parallel less files compilation that uses all or defined number of cpu cores. We have many less files and it takes about 11mins to compile them all.
Thank you for consideration.
Hi, I am able to get the JS plugin to work but as soon as I add dependencies classpath and apply plugin: "css"
I get the following crash log - I am running java 1.6:
$ gradle -b artoo/build.gradle --stacktrace
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/jobs/DummyJob/workspace/artoo/build.gradle' line: 13
* What went wrong:
A problem occurred evaluating root project 'artoo'.
> com/eriwen/gradle/css/source/internal/InternalGradle : Unsupported major.minor version 51.0
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'artoo'.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:54)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:127)
at org.gradle.configuration.BuildScriptProcessor.evaluate(BuildScriptProcessor.java:38)
at org.gradle.configuration.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:43)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:463)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:75)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:23)
at org.gradle.configuration.ProjectEvaluationConfigurer.execute(ProjectEvaluationConfigurer.java:21)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:38)
at org.gradle.configuration.DefaultBuildConfigurer$1.execute(DefaultBuildConfigurer.java:35)
at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:439)
at org.gradle.api.internal.project.AbstractProject.allprojects(AbstractProject.java:434)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:30)
at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:200)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:138)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: java.lang.UnsupportedClassVersionError: com/eriwen/gradle/css/source/internal/InternalGradle : Unsupported major.minor version 51.0
at com.eriwen.gradle.css.CssExtension.class$(CssExtension.groovy)
at com.eriwen.gradle.css.CssExtension.$get$$class$com$eriwen$gradle$css$source$internal$InternalGradle(CssExtension.groovy)
at com.eriwen.gradle.css.CssExtension.<init>(CssExtension.groovy:16)
at com.eriwen.gradle.css.CssExtension_Decorated.<init>(Unknown Source)
at org.gradle.internal.reflect.DirectInstantiator.newInstance(DirectInstantiator.java:41)
at org.gradle.api.internal.ClassGeneratorBackedInstantiator.newInstance(ClassGeneratorBackedInstantiator.java:36)
at org.gradle.api.internal.plugins.DefaultConvention.create(DefaultConvention.java:114)
at com.eriwen.gradle.css.CssPlugin.apply(CssPlugin.groovy:25)
at com.eriwen.gradle.css.CssPlugin.apply(CssPlugin.groovy)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.providePlugin(DefaultProjectsPluginContainer.java:107)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.addPluginInternal(DefaultProjectsPluginContainer.java:71)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:841)
at org.gradle.api.Project$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at build_3j352d9v31ib768u4coplb6iju.run(/var/lib/jenkins/jobs/DummyJob/workspace/artoo/build.gradle:13)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:52)
... 33 more
BUILD FAILED
Total time: 7.198 secs
My build.gradle file:
// Pull the plugin from a Maven Repo
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-js-plugin:1.1'
classpath 'com.eriwen:gradle-css-plugin:1.1.1'
}
}
// Invoke the plugin
apply plugin: 'js'
apply plugin: 'css'
def jsSrcDir = 'public/javascripts'
combineJs {
source = fileTree(dir: jsSrcDir)
dest = file("$buildDir/all.js")
}
minifyJs {
source = combineJs
dest = file("$buildDir/all-min.js")
closure {
warningLevel = "QUIET"
}
}
gzipJs {
source = minifyJs
dest = file("$buildDir/website-all-min.js")
}
I am pretty sure it is very simple and I am missing something fairly basic.
Thanks for your help!
It would be a cool feature for this plugin to add another task that is a daemon that we can run during development. The daemon would watch less files for changes, then compile them right away, so that developers can easily see changes upon refresh of the browser.
For the record, I am new to github. I don't know how to put this issue in the feature section, or even if there is a feature section, so if this comment is in the wrong place, i apologize.
I tried to apply the plugin to my project but using the csslint task fails.
I'm getting
No such property: source for class: com.eriwen.gradle.css.CssLintExtension_Decorated
when I configure
css.source {
dev {
css {
srcDir "src/main/resources/static/css"
include "*.css"
exclude "*.min.css"
}
}
}
csslint {
source = css.source.dev.css.files
dest = "${buildDir}/csslint.out"
}
and run gradle csslint
.
I'm using Gradle 2.7 on Linux with JDK 1.8.0_60.
I use subdirs in my less directory:
src/main/less
+- testroot.less
+- subdir
+- test.less
I configured the lesscss task like this:
// classpath 'com.eriwen:gradle-css-plugin:1.11.1'
// ...
css.source {
dev {
css {
srcDir "src/main/less"
include "**/*.less"
}
}
}
lesscss {
source = css.source.dev.css.files
dest = "${buildDir}/styles"
}
But all css files end up in the output directory without subdirs:
test.css
testroot.css
Am I doing something wrong?
Integrate automatic SASS compilation once tim-group/SassPlugin#1 is done.
You already implemented source extension. The next step is to use gradle Rule to create pipeline of combineCss, minifyCss, gzipCss for each source
Example:
css.source {
dev {
css {
srcDir "app/styles"
include "*.css"
exclude "*.min.css"
}
transpileOpt {
// your tasks options for combineCss, minifyCss, gzipCss
}
}
}
When you run this command
$ ./gradlew transpileDev
More about gradle Rule:
http://chimera.labs.oreilly.com/books/1234000001741/ch03.html#_rules
css.source {
dev {
css {
srcDir "src/main/webapp/resources/less"
include "*.less"
}
}
}
println "css.source.dev.css.files"
println css.source.dev.css.srcDirs
println css.source.dev.css.files
lesscss {
source = css.source.dev.css.files
dest = "${buildDir}/styles"
}
println lesscss.dest
outputs:
css.source.dev.css.files
[C:\work\views\tms\proto\tms\web\src\main\webapp\resources\less]
[C:\work\views\tms\proto\tms\web\src\main\webapp\resources\less\test.less]
C:\work\views\tms\proto\tms\web\build\styles
but no files are being copied over to the destination. any advice?
Hi !
Using minifyCss :
@keyframes bug-example {
0% { ... }
100%{ ... }
}
is converting to :
@keyframes bug-example {
0 { ... }
100%{ ... }
}
But "0" in keyframes is ignored by firefox
Hi,
I was trying out the latest version (1.1.2) of your plugin but unfortunately I can't get csslint running. All tasks execute and complete as expected, except for csslint which starts a jvm that then consumes 100% cpu power, but never finishes. A file csslint.out is created, but does only contain two open xml header. I'm using the gradle plugin settings directoly from your homepage. These are the last lines I see when I execute gradle csslint --info:
An attempt to initialize for well behaving parent process finished.
Successfully started process 'command '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java''
Building > :csslint
I'm running this on:
mac osx 10.8.2 , gradle 1.3, java 1.6.0_37
Any suggestions on how to debug this behaviour?
https://plugins.gradle.org/plugin/com.eriwen.gradle.css shows that the latest version is 1.11.1
Do the latest versions need to be pushed to gradle plugins?
If they are not on plugins.gralde.org then the "id" format does not work:
plugins {
id "com.eriwen.gradle.css" version "2.12.0"
}
But the old/alternate format does work fine:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.eriwen:gradle-js-plugin:2.12.0'
classpath 'com.eriwen:gradle-css-plugin:2.12.0'
}
}
I like to submit useless issues on others' projects.
I have this simple tests:
task combineCssMandatory(type: com.eriwen.gradle.css.tasks.CombineCssTask) {
source = ["WebContent/css/min/bootstrap.css", "WebContent/plugin/bootstrap-modal/css/bootstrap-modal.css", "WebContent/css/redicons.css", "WebContent/css/style.css"]
dest = file("WebContent/css/style-all.css")
}
task minifyCssMandatory(type: com.eriwen.gradle.css.tasks.MinifyCssTask) {
source = combineCssMandatory
dest = file("WebContent/css/style-all-min.css")
}
It combines the files correctly, but when It tries to minify, this is what happens (debug log)
17:33:35.353 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':minifyCssMandatory'.
17:33:35.364 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
17:33:35.377 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
17:33:35.388 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
17:33:35.400 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
17:33:35.412 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
17:33:35.422 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
17:33:35.432 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
17:33:35.445 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
17:33:35.457 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
17:33:35.467 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
17:33:35.478 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
17:33:35.491 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
17:33:35.503 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
17:33:35.515 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$1.run(DefaultTaskPlanExecutor.java:33)
17:33:35.527 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22)
17:33:35.538 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
17:33:35.550 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266)
17:33:35.560 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135)
17:33:35.576 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:95)
17:33:35.587 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31)
17:33:35.598 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
17:33:35.610 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
17:33:35.621 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
17:33:35.631 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
17:33:35.641 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
17:33:35.652 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
17:33:35.662 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
17:33:35.673 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
17:33:35.683 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
17:33:35.693 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
17:33:35.703 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
17:33:35.713 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
17:33:35.725 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
17:33:35.736 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
17:33:35.749 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
17:33:35.759 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
17:33:35.771 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
17:33:35.782 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
17:33:35.795 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
17:33:35.807 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
17:33:35.819 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
17:33:35.830 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
17:33:35.841 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
17:33:35.851 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
17:33:35.861 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:46)
17:33:35.872 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
17:33:35.884 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:37)
17:33:35.897 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
17:33:35.907 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
17:33:35.923 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
17:33:35.937 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.StackOverflowError
17:33:35.950 [ERROR] [org.gradle.BuildExceptionReporter]
17:33:35.960 [LIFECYCLE] [org.gradle.BuildResultLogger]
17:33:35.970 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
17:33:35.981 [LIFECYCLE] [org.gradle.BuildResultLogger]
17:33:35.991 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 17.971 secs
At first, I checked the combined file. It had like 7.4k linhas. I made a test with 600 lines ad the overFlow still happened.
As I said on the title, my gradle version is 1.10. And the plugin version I´m using is 1.8.3.
I am using Gradle 1.8 and am successfully using combineCss
and minifyCss
. I have just added the less
task to the mix, however it's reporting that there are no files:
:lesscss (Thread[Daemon Thread 2,5,main]) started.
:lesscss
Skipping task ':lesscss' as it has no source files.
:lesscss UP-TO-DATE
Possibly of relevance is a warning about deprecated dynamic property "source" and "dest".
Here's the relevant hunk from my build.gradle
file:
buildscript {
repositories { mavenCentral() }
dependencies {
classpath 'com.eriwen:gradle-css-plugin:1.8.0'
}
}
apply plugin: 'css'
css.source {
core {
css {
srcDir "src/main/webapp/css"
include "*.css"
exclude "*.min.css"
}
}
bootstrap {
css {
srcDir "src/main/webapp/bootstrap/css"
include "*.css"
exclude "*.min.css"
}
}
less {
css {
srcDir "src/main/webapp/bootstrap/less"
include "*.less"
}
}
}
combineCss {
source = [ css.source.bootstrap.css.files, css.source.core.css.files ]
dest = "${buildDir}/loupe.css"
}
minifyCss {
source = "${buildDir}/loupe.css"
dest = "src/main/webapp/css/loupe.min.css"
}
minifyCss.dependsOn 'combineCss'
less {
source = css.source.less.css.files
dest = 'src/main/webapp/bootstrap/css'
}
I can verify that the src/main/webapp/bootstrap/less
directory does contain less files.
(As an aside, the reason why I'm writing the minified and less files directly into the application's source is so I can easily run the application within Eclipse without having to mess with starting Jetty via Gradle and the related debugging fun that entails)
When running the less task on a less file with the a UTF-8 file with the BOM the plugin throws the below:
Execution failed for task ':lesscss'.
the number of constructors during runtime and compile time for java.lang.RuntimeException do not match. Expected 4 but got 5
No signature of method: static org.gradle.util.ConfigureUtil.configure() is applicable for argument types: (build_3zd3fapbn9bh6cuuurd1l8cy8$_run_closure7$_closure16, com.eriwen.gradle.css.source.internal.DefaultCssSourceSet_Decorated, java.lang.Boolean) values: [build_3zd3fapbn9bh6cuuurd1l8cy8$_run_closure7$_closure16@782e8e45, ...]
Possible solutions: configure(groovy.lang.Closure, java.lang.Object)
Last release is 2.12.0.
2.14.0 is not found in jcenter or maven.
I have over 50 .less files in my project and the task only tells us that the error occurred on line 14 column 21 of some file. i.e. no way of knowing what file the error actually occurred in.
The latest master
branch fails to build successfully:
I have included fixes for both of these in my pull request at #53. The PR was originally intended to fix a Gradle deprecation warning but required the additional fixes so that it could pass its status checks.
Sample build.gradle file in the README and GitHub page are different and outdated (1.1.1 & 1.8.1).
When there is a CSS property such as calc(10px + 48%)
, it gets compressed to calc(10px+48%)
, which doesn't work (calc requires spaces around the operator). Note that this bug only exists with the "+" sign—the "-" sign works fine
calc(10px + 48%)
to calc(10px - -48%)
Hello,
Is it possible to use this plugin in a way to combine different files not all files at once, e.g.
if I have following source files:
src/layout.css
src/colors.css
src/page1.css
src/page2.css
src/page3.css
Then what I need is to have following minified files:
build/page1.min.css (layout+colors+page1)
build/page2.min.css (layout+colors+page2)
build/page3.min.css (layout+colors+page3)
How to do this? Thanks in advance!
In the examples on the main GitHub page, the first example shows:
css {
input.files fileTree(dir: "${projectDir}/css", include: "**/*.css")
output.file file("${buildDir}/combinedMinifiedAndGzipped.css")
}
I think it should actually be:
css {
inputs.files fileTree(dir: "${projectDir}/css", include: "**/*.css")
outputs.file file("${buildDir}/combinedMinifiedAndGzipped.css")
}
Where input and output become inputs and outputs.
(Thanks for the great plugins! I'm loving them so far!)
Hey,
I want to use the plugin but it does not keep the order of the input css files when combining them. When I input 1.css and 2.css to be combined to all.css I want to have the content 1.css first in the file and then 2.css.
Would be great if you could incorporate this.
Cheers,
Sebastian
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.