The Wayback Machine - http://web.archive.org/web/20210106151512/https://github.com/wireapp/wire-android/pull/3083
Skip to content
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

Build System Improvement - Part2 #3083

Open
wants to merge 7 commits into
base: develop
from

Conversation

@mejdoo
Copy link
Contributor

@mejdoo mejdoo commented Nov 4, 2020

What's new in this PR?

This is a follow up of #3073

Main improvements

  • Merge quality related stuff in one gradle file quality.gradle and move all the configs below the root /config folder
  • Improve versioning
  • Manage FeatureFlags from Kotlin DSL.
@mejdoo
Copy link
Contributor Author

@mejdoo mejdoo commented Nov 4, 2020

build again

buildSrc/src/main/kotlin/FeatureFlags.kt Outdated Show resolved Hide resolved
//**************** Lint *****************//

subprojects {
if (project.plugins.hasPlugin('com.android.application')) {

This comment has been minimized.

@gizemb

gizemb Nov 4, 2020
Contributor

what about library projects? storage, zmessaging, etc?

This comment has been minimized.

@mejdoo

mejdoo Nov 8, 2020
Author Contributor

lint was enabled only for the app module, if that makes sense we can enabled as well for the libraries.

This comment has been minimized.

@gizemb

gizemb Nov 9, 2020
Contributor

hmm, ok. I saw that there is another configuration ready for library modules, but didn't know that it was disabled for them.

scripts/quality.gradle Outdated Show resolved Hide resolved
scripts/quality.gradle Outdated Show resolved Hide resolved
*/

//**************** Checkstyle *****************//

This comment has been minimized.

@gizemb

gizemb Nov 4, 2020
Contributor

I think we can break this thing down even more into their own files and add

apply from checkstyle
apply from pmd
...

here

This comment has been minimized.

@mejdoo

mejdoo Nov 4, 2020
Author Contributor

I started by doing a single gradle file for each section in #3073 detekt.gradle and jacoco.gradle. Then, @BradleyWire suggested to do it in a single place quality.gadle. It's not a requirement but think it's better to follow the same approach of "reloaded".

This comment has been minimized.

@BradleyIW

BradleyIW Nov 4, 2020
Contributor

Yes, we can still do a single quality.gradle file and apply that but the quality.gradle file can have its own scripts as described by Gizem above. Ideally we would only import quality.gradle for libraries or application projects

This comment has been minimized.

@android10

android10 Nov 5, 2020
Member

I jump in here, because I was the one putting everything inside the quality file.
At the time being, the file is not big and perfectly understandable. Personally I found this the best way of organizing scripts by aspects. If we start creating these tiny scripts, we are loosing consistency, since there are aspects and technologies mixed up.

We have 2 options, either we put everything in one file as soon as the file does not grow until it turns into a God Script or we change our strategy and organization related to scripts.
If you feel like the second option, please drop your suggestions.

This comment has been minimized.

@gizemb

gizemb Nov 6, 2020
Contributor

I personally find it big, but I don't mind if it stays as it is. the main reason why I requested changes was the typo and this comment. the typo has been fixed but I still don't have an answer for the other question. As soon as I get an answer to it I can revoke my CR.

@@ -1,232 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>

This comment has been minimized.

@gizemb

gizemb Nov 4, 2020
Contributor

what was the difference between this config and lint-config-with-unused.xml exactly?

Copy link
Member

@android10 android10 left a comment

👍 I'm approving but I would definitely like to start a discussion or have an answer to my comments.

apply from: "./scripts/licensing.gradle"
apply from: "./scripts/customization.gradle"
apply from: "./scripts/whitelabel.gradle"

This comment has been minimized.

subprojects {

This comment has been minimized.

@android10

android10 Nov 5, 2020
Member

We have to be careful with this, because we do not want to get ownership over code taken from other projects. For Example there are some files that were taken from my project...I do not mind to be honest, but changing the author could bring even legal problems and as far as I understand, that will apply to all files right?

This comment has been minimized.

@mejdoo

mejdoo Nov 5, 2020
Author Contributor

Good point, I totally agree with you opinion regarding copyright. This will apply to all files in the all the modules with the following extensions .java .scala, .gradle, .xml. .kt is missing btw. What do you suggest then? Should we ignore some specific files or disable completely the licensing plugin to stay in the safe side?

This comment has been minimized.

@android10

android10 Nov 5, 2020
Member

I would suggest a way to check whether this header exist first. If does not, then add it.
I do not know the plugin and I do it manually in my projects, actually the IDE does it for me within new files.

In any case, we have to be responsible if we are copying code from other projects. It is a commitment.
So just make sure we are taking any ownership from code that does not belong to us.

This comment has been minimized.

@android10

android10 Nov 5, 2020
Member

I guess we have to investigate a bit here, Unless someone else has experience on this topic.
cc @makingthematrix @gizemb @BradleyWire

This comment has been minimized.

@makingthematrix

makingthematrix Nov 5, 2020
Contributor

As far as I understand, every source code file should start with the header. If the code contains a snipped taken from elsewhere, that code should additionally be preceded by a comment about who is the author and where was it taken from. We should copy-paste whole files from other projects.

*/

//**************** Checkstyle *****************//

This comment has been minimized.

@android10

android10 Nov 5, 2020
Member

I jump in here, because I was the one putting everything inside the quality file.
At the time being, the file is not big and perfectly understandable. Personally I found this the best way of organizing scripts by aspects. If we start creating these tiny scripts, we are loosing consistency, since there are aspects and technologies mixed up.

We have 2 options, either we put everything in one file as soon as the file does not grow until it turns into a God Script or we change our strategy and organization related to scripts.
If you feel like the second option, please drop your suggestions.

@gizemb
gizemb approved these changes Nov 9, 2020
@mejdoo mejdoo force-pushed the feature/refactor_build_system_part_2 branch from 52f577f to 8469aa7 Nov 11, 2020
@mejdoo mejdoo force-pushed the feature/refactor_build_system_part_2 branch from 2366f5d to 4b4c713 Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.