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

refactor: Create module with shared utilities #1418

Merged
merged 7 commits into from
Dec 22, 2020

Conversation

piotradamczyk5
Copy link
Contributor

@piotradamczyk5 piotradamczyk5 commented Dec 21, 2020

Fixes #1402

:common modules with shared utils created. Many files has been changed in this PR, however they are mostly import changes

Test Plan

How do we know the code works?

:common is available, all tests passed

Copy link
Contributor

@Sloox Sloox left a comment

Choose a reason for hiding this comment

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

Minor comments but looks good 👍

@@ -0,0 +1,14 @@
# Compiled class file
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we perhaps use a gitignore generator
EG : https://www.toptal.com/developers/gitignore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

import java.nio.file.Paths

val userHome: String by lazy {
if (isWindows) System.getenv("HOMEPATH") else System.getProperty("user.home")
Copy link
Contributor

Choose a reason for hiding this comment

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

Need me to test locally on my machine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just moved this code, should work properly 🤞


private val osName = System.getProperty("os.name")?.toLowerCase() ?: ""

val isMacOS: Boolean by lazy {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a isLinux? or is it the "else" case?

Copy link
Contributor Author

@piotradamczyk5 piotradamczyk5 Dec 22, 2020

Choose a reason for hiding this comment

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

basically we just use isWindows and isMacOS, but we could add isLinux


fun String.normalizeLineEnding(): String {
// required for tests to pass on Windows
return this.replace("\r\n", "\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

🥇

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just copy-paste code :D

@pawelpasterz
Copy link
Contributor

@flank-it

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2020

Integration tests failed, you could see results here

Copy link
Contributor

@pawelpasterz pawelpasterz left a comment

Choose a reason for hiding this comment

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

Just to prevent automatic merge, until the issue with failing tests is solved

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2020

Timestamp: 2020-12-22 16:38:28
Buildscan url for ubuntu-workflow run 438460178
https://gradle.com/s/gfvhbga2u2dhq

@piotradamczyk5 piotradamczyk5 force-pushed the #1402_common_module branch 2 times, most recently from c8cde13 to 524d43a Compare December 22, 2020 15:28
@piotradamczyk5
Copy link
Contributor Author

@flank-it

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2020

Integration tests succeed, you could see results here

@piotradamczyk5 piotradamczyk5 enabled auto-merge (squash) December 22, 2020 16:49
@piotradamczyk5 piotradamczyk5 merged commit f3f2455 into master Dec 22, 2020
@piotradamczyk5 piotradamczyk5 deleted the #1402_common_module branch December 22, 2020 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create module with shared utilities
3 participants