-
Notifications
You must be signed in to change notification settings - Fork 36
Allow skip Android related gradle tasks #134
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
Allow skip Android related gradle tasks #134
Conversation
settings.gradle.kts
Outdated
if (System.getenv("ANDROID_SDK_ROOT") != null) { | ||
return true; | ||
} | ||
// TODO: Check if `sdk.dir` property is defined in `local.properties` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this. If sdk.dir
property is not defined in local.properties
, it's up to the user to configure it. The ID or the command line will notify if the environment is misconfigured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea of this PR is to conditionally include the projects depending on the presence of the android SDK.
The projects should be included if the Android SDK is available (ANDROID_SDK_ROOT
env variable or sdk.dir
property) or it's running on the CI
Considering this we need read the property to ensure that it is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find official docs right now, anyway the local.properties
file will be recreated if missing with content of the ANDROID_SDK_ROOT
. So it's sufficient to check for the env variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the PR reversing the logic (decide, via env variable, if android should be skipped) because there is no way to access to the content of local.properties
within settings.gradle.kts
.
This is relevant to me as I might define the Android SDK into the local properties file (and no env variable) and it would be annoying if Android tasks would be ignored.
About no way to access to the content, technically there is a hack that can be used (cat ... | grep sdk.dir
) but it look bad enough to read a file hoping that a string is present.
So I've decided to get a different direction here.
c2ce98f
to
baa1b4a
Compare
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
============================================
- Coverage 74.56% 74.38% -0.19%
Complexity 173 173
============================================
Files 11 11
Lines 684 687 +3
Branches 86 86
============================================
+ Hits 510 511 +1
- Misses 128 130 +2
Partials 46 46
Continue to review full report at Codecov.
|
…ariable is defined
baa1b4a
to
995ea19
Compare
The change is described in #134 (comment) |
The goal of this PR is to allow development and testing of the library on systems where the Android SDK is not available.
Currently the Android dependencies are mostly needed for the sample projects, which gives an idea on how to use/integrate the library into end-user scenarios, but is not needed to test the overall library functionality.
In order to disable the inclusion/execution of the Android related tasks is sufficient to define
SKIP_ANDROID
environmental variable.Anyway we want to guarantee that Android related tasks are executed on
CI
(almost all the public CI systems do exposeCI=true
environmental variable).