Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Migrate to Gradle DSL as a build tool #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 22, 2019
Merged

Migrate to Gradle DSL as a build tool #73

merged 16 commits into from
Feb 22, 2019

Conversation

Pazus
Copy link
Member

@Pazus Pazus commented Feb 17, 2019

Migrate from Maven XML-based POM build configuration to static typed Gradle DSL (Uses Kotlin script facilities). The new version is much more readable and short. It’s quite easy to implement new features even the most custom one as we can use Kotlin to code anything we like right in the build file. Gradle is a modern widely used build tool which means there is only a small chance we have to write something custom. Anything that is possible with Maven can be reproduced with Gradle with (likely) fewer lines of code.

The main thing to understand is that Gradle build consists of “tasks” similar to Maven goals. You ask Gradle to execute a goal an it executes all required goals to execute the requested one. We can create new goals and introduce new dependencies if needed. Such approach is used to download Coverage resources.

I’ve made a small change to how we work with resources. I download it directly to the build directory so that sources don’t change on build as it’s a bad practice.

I also temporary added deployment of the snapshot to packagecloud for this branch to test it. Should be eliminated before merge.

@Pazus Pazus requested review from jgebal, viniciusam and pesse February 17, 2019 09:52
@Pazus Pazus force-pushed the gradle-dsl-migration branch from 9ae8c88 to 1f34cd6 Compare February 17, 2019 13:13
@Pazus
Copy link
Member Author

Pazus commented Feb 17, 2019

I'll leave pom.xml until the PR is approved so you can compare. I'm going to remove it before merging.

@@ -0,0 +1,172 @@
#!/usr/bin/env sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generated file

@@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is generated file

Copy link
Member

@viniciusam viniciusam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, looks good! Have you noticed any difference in the build time?

@Pazus
Copy link
Member Author

Pazus commented Feb 19, 2019

Great job, looks good! Have you noticed any difference in the build time?

Thank you for the concerntion! It's actually a bit slower on CI, but I'll try to speed it up. Btw gradle is definitely much faster on your own machine while you develop as it heavily uses incremental builds and caches so it builds only needed things. On my machine the clean build takes 4s, second build - 1s.

Copy link
Member

@pesse pesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I love this new approach! Never did it myself, but it's actually code, which you know I like waaaay more than XML configuration ;)

@Pazus Pazus merged commit 1d4dc11 into develop Feb 22, 2019
@Pazus Pazus deleted the gradle-dsl-migration branch February 22, 2019 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants