Skip to content

Experimental Windows support#77

Closed
mezpahlan wants to merge 42 commits intodropbox:mainfrom
mezpahlan:experimental-windows-support
Closed

Experimental Windows support#77
mezpahlan wants to merge 42 commits intodropbox:mainfrom
mezpahlan:experimental-windows-support

Conversation

@mezpahlan
Copy link
Copy Markdown
Contributor

@mezpahlan mezpahlan commented Sep 5, 2021

Attempt to address #37 by adding experimental Windows support (I say experimental because really what we should be doing is using an abstract file system like the one from Okio and write proper tests for each known target platform - Linux, Mac, Windows. However to begin with I just wanted to get something that worked on Windows.)

The main issue I noticed was that GitClientImpl seems to always return Unix-like line endings and path separators - "\n" / "/". However Gradle returns the appropriate constants for the target operating system. On Windows this is "\r\n" / "\". The AffectedModuleDetector (at its heart) compares the output from Git with the output from Gradle and compares the two to work out changes. Therefore each output needs to be in the same format.

The main changes are:

  1. Convert line endings and path separators from the output of Git to the OS specific versions to match what Gradle will do.
  2. Create a canonical buildSrc directory for both the plugin module and the sample module.
  3. Include sample module in the project.
  4. Align the version in the release and the sample project (this was out of date).
  5. General whitespace cleanup.
  6. Add a TestRule to ensure that the Android SDK location is known to the integration tests (not everyone has an environment variable set 😉 ).
  7. Change use of illegal characters on Windows file systems in tests (cannot use ":" on Windows 😢 ).
  8. Fix META-INF properties file for sample project.
  9. Overwrite the log file (on large projects it becomes huge really quickly so reading becomes an issue, we might want to put overwriting / appending behind a configuration in the future).
  10. Add support for quixotic projects (the project I am working on isn't structured in a way the plugin assumes - it is non standard but nevertheless valid Gradle).

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This is so that we can more easily share versions between the main
project and the sample project to avoid a mismatch.
Preparing for Kotlin DSL.
Circular dependency issue since you need to have built and published the
 plugin to mavenLocal first before you can meaningfully use anything in
 the sample directory :(. For the time being we will do this by hand.
Do not assume Unix like path separators and illegal characters.
TestRule for those of us that have not set the ANDROID_SDK_ROOT
environment variable.
These are forced to Unix-like characters but Gradle interprets them in
the correct OS format. This only causes problems on Windows machines but
 needs proper handling.
Remove unused / not referenced projects. Fix p5 dependency.
It is safe to use the forward slash "/" character when working with
Gradle or Java File as they both understand how to handle this on all
platforms. The Git client is the one that causes us problems.
This distinguishes what the file tree relationship is as opposed to the
dependency relationship. It should also make it easier to express more
complex set ups.
This file can grow extremely quickly. When that happens, trying to read
it becomes tricky. We should probably put this behind a configuration in
 the future.
Protects against users specifying the wrong path separator.
@mezpahlan mezpahlan force-pushed the experimental-windows-support branch from d33c739 to 1b51713 Compare September 13, 2021 20:22
@mezpahlan
Copy link
Copy Markdown
Contributor Author

Apologies my company won't allow me to sign the CLA and as I have done the work during company time I don't feel correct signing the agreement myself.

The commits are there if you want them but I will close this PR. Thanks.

@mezpahlan mezpahlan closed this Dec 20, 2021
@mezpahlan mezpahlan deleted the experimental-windows-support branch October 7, 2023 19:39
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.

2 participants