Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: windows issues #1564

Merged
merged 3 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/full_suite_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ jobs:

- name: Prepare Google Service Account
env:
GOOGLE_CLOUD_PROJECT: flank-open-source #needs to be removed.
GCLOUD_KEY: ${{ secrets.GCLOUD_KEY }}

run: |
if [ "$RUNNER_OS" == "Windows" ]; then
set GCLOUD_DIR="%HOMEPATH%/.config/gcloud/"
Expand Down
8 changes: 5 additions & 3 deletions common/src/main/kotlin/flank/common/Files.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ fun createCopy(sourceDirectoryLocation: String, destinationDirectoryLocation: St
copyDirectory(sourceDirectoryLocation, destinationDirectoryLocation)
}

fun createFileCopy(source: String, destination: String): Path = Files.copy(Paths.get(source), Paths.get(destination))

fun copyDirectory(sourceDirectoryLocation: String, destinationDirectoryLocation: String) {
Files.walk(Paths.get(sourceDirectoryLocation))
.forEach { source: Path ->
Expand Down Expand Up @@ -68,9 +70,9 @@ fun createSymbolicLink(
Paths.get(target).toAbsolutePath().normalize()
)

fun createSymbolicLinkToFile(link: Path, target: Path) {
Files.createSymbolicLink(link, target.fileName)
}
fun createLinkToFile(link: Path, target: Path): Path =
if (isWindows) createFileCopy(target.toString(), link.toString())
else Files.createSymbolicLink(link, target.fileName)

fun downloadFile(sourceUrl: String, destination: String) {
Fuel.download(sourceUrl)
Expand Down
2 changes: 1 addition & 1 deletion common/src/test/kotlin/flank/common/FilesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class FilesTest {
val expectedDestination = Paths.get(root.newFolder("temp").toString(), "test.link")

// when
createSymbolicLinkToFile(expectedDestination, testFile)
createLinkToFile(expectedDestination, testFile)

// then
assertTrue(Files.isSymbolicLink(expectedDestination))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ftl.ios.xctest.common
import flank.common.OutputLogLevel
import flank.common.appDataDirectory
import flank.common.createDirectoryIfNotExist
import flank.common.createSymbolicLinkToFile
import flank.common.createLinkToFile
import flank.common.downloadFile
import flank.common.hasAllFiles
import flank.common.isMacOS
Expand Down Expand Up @@ -54,7 +54,7 @@ private fun downloadAndUnzip(osname: String) {
it.setExecutable(true)
}
Files.delete(destinationFile)
createSymbolicLinkToFile(
createLinkToFile(
link = Paths.get(flankBinariesDirectory.toString(), "libatomic.so.1"),
target = Paths.get(flankBinariesDirectory.toString(), "libatomic.so.1.2.0")
)
Expand Down