Is Gradle Wrapper command part of AGP or Gradle? - gradle

We cannot see an answer to the question on whether command like ./gradlew lint is part of Android Gradle Plugin (AGP) or the Gradle itself. We are getting error when executing lint but it seems a bug with the lint itself and we are not sure if we supposedly report it on AGP or Gradle.
Logs:
Error: Unexpected failure during lint analysis of ActivityExt.kt (this is a bug in lint or one of the libraries it depends on)
No error in the code nor lint warning and this is working before the update.

The ./gradlew lint command is actually a way to invoke the lint function that is bundled as part of the Android SDK, using gradle.
So the bug with the lint tool should be reported to Android.

Related

Gradle build stuck at compile Java

I'm trying to build a project, but the gradle build is stuck on compile java, I don't know how to fix it:
Gradle is actually very specific what has happened. There're compilation errors in project gene-model-dom.
Execution failed for task ':gene-model:gene-model-dom:compileJava'.
> Compilation failed; see the compiler output for details
To see the exact errors, run the build again with --info switch. For example (your mileage may vary):
gradlew --info :gene-model:gene-model-dom:compileJava

Trying to beta distribute a native script build using crashlytics

To distribute a build with crashlytics the documentation at:
https://docs.fabric.io/android/beta/gradle.html
States that I need to execute
gradle assembleRelease crashlyticsUploadDistributionRelease
How would i go about doing this with nativescript.
The build command is
tns build android --release
The above command is essentially gradle assembleRelease plus whatever native needs to do.
How do I append the crashlyticsUploadDistributionRelease task to the tns build command?
I have seen this documentation in nativescript:
https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/gradle-hooks
I am not sure how to use the gradle-hooks to do this.

how to build Elasticsearch source code using gradle?

I download elasticsearch source code from :https://github.com/elastic/elasticsearch,
I found there is a build.gradlefile,and I have install gradle,
how to build source it?
There is a description fo the way you can build it in the readme file in the repo. According to it:
Building from Source
Elasticsearch uses Gradle for its build system. You’ll need to have
version 2.13 of Gradle installed.
In order to create a distribution, simply run the gradle assemble
command in the cloned directory.
The distribution for each project will be created under the
build/distributions directory in that project.
See the TESTING file for more information about running the
Elasticsearch test suite.
So all you need is to get into the root directory and in command line call gradle assemble, if you have Gradle installed properly, you will find all artifacts under build/distributions directory
gradle assemble seems to yield some errors such as cannot find symbol in my macOS environment.
According to the latest description in the repo (as of time writing the answer):
To build a distribution for your local OS and print its output location upon completion, run:
./gradlew localDistro
To build a distribution for another platform, run the related command:
./gradlew :distribution:archives:linux-tar:assemble
./gradlew :distribution:archives:darwin-tar:assemble
./gradlew :distribution:archives:windows-zip:assemble
To build distributions for all supported platforms, run:
./gradlew assemble
Distributions are output to distributions/archives.

Difference between using gradlew and gradle

What is the difference between using gradlew and gradle or are they the same?
The difference lies in the fact that ./gradlew indicates you are using a gradle wrapper. The wrapper is generally part of a project and it facilitates installation of gradle. If you were using gradle without the wrapper you would have to manually install it - for example, on a mac brew install gradle and then invoke gradle using the gradle command. In both cases you are using gradle, but the former is more convenient and ensures version consistency across different machines.
Each Wrapper is tied to a specific version of Gradle, so when you
first run one of the commands above for a given Gradle version, it
will download the corresponding Gradle distribution and use it to
execute the build.
Not only does this mean that you don’t have to manually install Gradle
yourself, but you are also sure to use the version of Gradle that the
build is designed for. This makes your historical builds more reliable
Read more here - https://docs.gradle.org/current/userguide/gradle_wrapper.html
Also, Udacity has a neat, high level video explaining the concept of the gradle wrapper - https://www.youtube.com/watch?v=1aA949H-shk
gradle vs gradlew
gradlew is a wrapper(w - character) that uses gradle.
Under the hood gradlew performs three main things:
Download and install the correct gradle version
Parse the arguments
Call a gradle task
Using Gradle Wrapper we can distribute/share a project to everybody to use the same version and Gradle's functionality(compile, build, install...) even if it has not been installed.
To create a wrapper run:
gradle wrapper
This command generate:
gradle-wrapper.properties will contain the information about the Gradle distribution
*./ Is used on Unix to specify the current directory

Travis not compiling all cocoapods

for a RubyMotion gem, I use Travis for the tests.
The tests are passing locally but fail on Travis.
The reason is quite simple, all the code from one pod is not fully compiled.
If you look at https://travis-ci.org/bmichotte/ProMotion-XLForm at line 838 (for the actual build), it compile only those files
Build ./Pods.xcodeproj [XLForm - Release]
Compile ./XLForm/XLForm/XL/Helpers/NSExpression+XLFormAdditions.m
Compile ./XLForm/XLForm/XL/Helpers/NSArray+XLFormAdditions.m
Compile ./XLForm/XLForm/XL/Helpers/NSPredicate+XLFormAdditions.m
Compile ./XLForm/XLForm/XL/Helpers/NSObject+XLFormAdditions.m
Compile ./XLForm/XLForm/XL/Helpers/NSString+XLFormAdditions.m
while locally, it compile all files.
I'm not sure who is guilty (cocoapods, rubymotion, motion-cocoapods, ...) ? because it use the exact same version as I am using except xcode (6.1 on Travis, 6.4 locally).
Any idea why this occurs ?
Ok, so after a --trace, I was able to find the issue
The pod I use, use nonnull, null_unspecified and other keywords supported by XCode 6.3+ while the default XCode on Travis is 6.1...
Adding osx_image: xcode6.4 on my .travis.yml corrected the issue...
Now, I only have to get a RubyMotion install on this.

Resources