spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » GRADLE » Page 1
How to get access to line number in file Copy filter task?
The Copy task just copies files (it can filter/expand files using Ant filters or Groovy SimpleTemplateEngine). You're looking for a pre-processor of sorts. I think it's possible to do that with a custom Ant filter, but it seems like a lot of work. I think what people typically do is use something like this at runtime to find the file/line number: How can I determine the current line number in J

Categories : Gradle

How to import the external libraries to target project's lib folder with Gradle
Putting libraries in the folder is possible and can be configured as in this tutorial. However if You use the local folder transitive dependencies will not be resolved - You need to put all the libraries in this folder if You'd like it to be the only repository for libraries. What You can do also is to exclude transitive dependencies as written here. The scenario is a bit unclear so I suppose that

Categories : Gradle

How Do I Call 7zip From Gradle To Unsign A Jar
Thanks to this post I realised what it should be. I am using the command line version of 7zip now - 7za. There is also a unix version at http://p7zip.sourceforge.net/ so I am packaging them both with my script and using something along the lines of the following: import org.apache.tools.ant.taskdefs.condition.Os task unSignJars() { if(Os.isFamily(Os.FAMILY_WINDOWS)) { println "*** WINDOWS

Categories : Gradle

getVersion() in custom Gradle plugin is always unspecified
project.configure(project) { println getVersion() } is the same as println project.version. If this prints unspecified, the build script didn't set (project.)version. As of Gradle 2.2, there isn't a built-in way for a plugin to declare or query its own version, but you could implement this yourself (for your own plugins).

Categories : Gradle

Publishing both jar and sources jar to Artifactory from Gradle
When it comes to publishing source you need to modify your script in the following way: publishing { publications { mavenJava(MavenPublication) { from components.java artifact (sourcesJar) { classifier = 'sources' } } } } When it comes to a single command what you need to do is to define dependencies between tasks. Unf

Categories : Gradle

Exclude packages from Jacoco report using Sonarrunner and Gradle
I have managed to exclude particular packages from coverage reports by using sonar.coverage.exclusions property in sonar-project.properties. Property is described in official documentation

Categories : Gradle

Gradle Task: open port to use as TaskInput
As You can see in the docs for TaskOutputs only files can be registered as an output - so no properties here. When it comes to TaskInputs properties can be indeed used and You can find a great example under '$GRADLE_HOME/samples/userguide/tasks/incrementalTask'. Try running: gradle incrementalReverse -PtaskInputProperty=<property> passing same <property> several times in a row and

Categories : Gradle

Gradle global variable not in scope within buildscript
This is happening because the buildscript {...} configuration closure is always evaluated first, so the property is not yet defined. A workaround would be to define the property outside of the build script, either by placing it in a gradle.properties file or via the command line.

Categories : Gradle

Gradle variable scoping
Local variables declared at the outermost level of a script aren't in scope of methods in the same script. This is due to how Groovy translates a script into a runnable class. One way around this is to use ext.myfun = { ... } instead, which solves the scoping problem and doesn't affect call sites (which can still use myfun()). Your other problem seems unrelated. project refers to the project that

Categories : Gradle


Recently Add
Executing commands with Gradle?
How to get access to line number in file Copy filter task?
How to import the external libraries to target project's lib folder with Gradle
How Do I Call 7zip From Gradle To Unsign A Jar
getVersion() in custom Gradle plugin is always unspecified
Publishing both jar and sources jar to Artifactory from Gradle
Exclude packages from Jacoco report using Sonarrunner and Gradle
Gradle Task: open port to use as TaskInput
Gradle global variable not in scope within buildscript
Gradle variable scoping
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.