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

feat(all): kotlin 1.5 #57

Merged
merged 3 commits into from
Oct 11, 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
14 changes: 8 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ jobs:
runs-on: macOS-10.15
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '11'
- uses: malinskiy/action-android/install-sdk@release/0.1.1
- name: build & test
run: ./gradlew assemble test jacocoTestReport
Expand Down Expand Up @@ -40,10 +41,11 @@ jobs:
api: [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ]
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '11'
- uses: malinskiy/action-android/install-sdk@release/0.1.1
- name: integration test
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.1
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy-github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ on:
tags: '*'
jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '11'
- uses: little-core-labs/get-git-tag@v3.0.2
- name: deploy-release
run: .buildsystem/deploy-github.sh
env:
GITHUB_MAVEN_USERNAME: ${{ secrets.GITHUB_MAVEN_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
11 changes: 6 additions & 5 deletions .github/workflows/deploy-sonatype-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ on:
tags: '*'
jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '11'
- uses: little-core-labs/get-git-tag@v3.0.2
- name: deploy-release
run: .buildsystem/deploy-sonatype.sh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
11 changes: 6 additions & 5 deletions .github/workflows/deploy-sonatype-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '11'
- name: deploy-snapshot
run: bash .buildsystem/deploy-sonatype.sh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
9 changes: 5 additions & 4 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ on:

jobs:
github-pages:
runs-on: ubuntu-16.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.8
distribution: 'temurin'
java-version: '11'
- name: Generate dokka files
run: ./gradlew :adam:dokkaHtml
- uses: helaili/jekyll-action@2.0.4
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions adam/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ java {

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.apiVersion = "1.4"
kotlinOptions.apiVersion = "1.5"
}

dependencies {
Expand All @@ -155,7 +155,8 @@ dependencies {
implementation(Libraries.ktorNetwork)
implementation(Libraries.logging)
api(Libraries.protobufLite)
api(Libraries.grpcKotlinStubLite)
api(Libraries.grpcProtobufLite)
api(Libraries.grpcKotlinStub)
api(Libraries.grpcOkhttp)
implementation(Libraries.javaxAnnotations)
implementation(Libraries.vertxCore)
Expand Down
50 changes: 34 additions & 16 deletions adam/src/main/kotlin/com/malinskiy/adam/Const.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,46 @@ object Const {
val SYNC_IGNORED_FILES = setOf(".", "..")

object Message {
val OKAY = byteArrayOf('O'.toByte(), 'K'.toByte(), 'A'.toByte(), 'Y'.toByte())
val FAIL = byteArrayOf('F'.toByte(), 'A'.toByte(), 'I'.toByte(), 'L'.toByte())
val OKAY = byteArrayOf('O'.code.toByte(), 'K'.code.toByte(), 'A'.code.toByte(), 'Y'.code.toByte())
val FAIL = byteArrayOf('F'.code.toByte(), 'A'.code.toByte(), 'I'.code.toByte(), 'L'.code.toByte())

val DATA = byteArrayOf('D'.toByte(), 'A'.toByte(), 'T'.toByte(), 'A'.toByte())
val DONE = byteArrayOf('D'.toByte(), 'O'.toByte(), 'N'.toByte(), 'E'.toByte())
val DATA = byteArrayOf('D'.code.toByte(), 'A'.code.toByte(), 'T'.code.toByte(), 'A'.code.toByte())
val DONE = byteArrayOf('D'.code.toByte(), 'O'.code.toByte(), 'N'.code.toByte(), 'E'.code.toByte())

val LSTAT_V1 = byteArrayOf('S'.toByte(), 'T'.toByte(), 'A'.toByte(), 'T'.toByte())
val LIST_V1 = byteArrayOf('L'.toByte(), 'I'.toByte(), 'S'.toByte(), 'T'.toByte())
val DENT_V1 = byteArrayOf('D'.toByte(), 'E'.toByte(), 'N'.toByte(), 'T'.toByte())
val SEND_V1 = byteArrayOf('S'.toByte(), 'E'.toByte(), 'N'.toByte(), 'D'.toByte())
val RECV_V1 = byteArrayOf('R'.toByte(), 'E'.toByte(), 'C'.toByte(), 'V'.toByte())
val LSTAT_V1 = byteArrayOf('S'.code.toByte(), 'T'.code.toByte(), 'A'.code.toByte(), 'T'.code.toByte())
val LIST_V1 = byteArrayOf('L'.code.toByte(), 'I'.code.toByte(), 'S'.code.toByte(), 'T'.code.toByte())
val DENT_V1 = byteArrayOf('D'.code.toByte(), 'E'.code.toByte(), 'N'.code.toByte(), 'T'.code.toByte())
val SEND_V1 = byteArrayOf('S'.code.toByte(), 'E'.code.toByte(), 'N'.code.toByte(), 'D'.code.toByte())
val RECV_V1 = byteArrayOf('R'.code.toByte(), 'E'.code.toByte(), 'C'.code.toByte(), 'V'.code.toByte())

val LIST_V2 = byteArrayOf('L'.toByte(), 'I'.toByte(), 'S'.toByte(), '2'.toByte())
val DENT_V2 = byteArrayOf('D'.toByte(), 'N'.toByte(), 'T'.toByte(), '2'.toByte())
val LSTAT_V2 = byteArrayOf('L'.toByte(), 'S'.toByte(), 'T'.toByte(), '2'.toByte())
val RECV_V2 = byteArrayOf('R'.toByte(), 'C'.toByte(), 'V'.toByte(), '2'.toByte())
val SEND_V2 = byteArrayOf('S'.toByte(), 'N'.toByte(), 'D'.toByte(), '2'.toByte())
val LIST_V2 = byteArrayOf('L'.code.toByte(), 'I'.code.toByte(), 'S'.code.toByte(), '2'.code.toByte())
val DENT_V2 = byteArrayOf('D'.code.toByte(), 'N'.code.toByte(), 'T'.code.toByte(), '2'.code.toByte())
val LSTAT_V2 = byteArrayOf('L'.code.toByte(), 'S'.code.toByte(), 'T'.code.toByte(), '2'.code.toByte())
val RECV_V2 = byteArrayOf('R'.code.toByte(), 'C'.code.toByte(), 'V'.code.toByte(), '2'.code.toByte())
val SEND_V2 = byteArrayOf('S'.code.toByte(), 'N'.code.toByte(), 'D'.code.toByte(), '2'.code.toByte())

val DONEDONE =
byteArrayOf('D'.toByte(), 'O'.toByte(), 'N'.toByte(), 'E'.toByte(), 'D'.toByte(), 'O'.toByte(), 'N'.toByte(), 'E'.toByte())
byteArrayOf(
'D'.code.toByte(),
'O'.code.toByte(),
'N'.code.toByte(),
'E'.code.toByte(),
'D'.code.toByte(),
'O'.code.toByte(),
'N'.code.toByte(),
'E'.code.toByte()
)
val FAILFAIL =
byteArrayOf('F'.toByte(), 'A'.toByte(), 'I'.toByte(), 'L'.toByte(), 'F'.toByte(), 'A'.toByte(), 'I'.toByte(), 'L'.toByte())
byteArrayOf(
'F'.code.toByte(),
'A'.code.toByte(),
'I'.code.toByte(),
'L'.code.toByte(),
'F'.code.toByte(),
'A'.code.toByte(),
'I'.code.toByte(),
'L'.code.toByte()
)
}

object FileType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ class ReconnectRequest(
* For some reason this done is lowercase and doesn't use the DONE message as everything else
* see daemon/services.cpp#reconnect_service
*/
val done = byteArrayOf('d'.toByte(), 'o'.toByte(), 'n'.toByte(), 'e'.toByte())
val done = byteArrayOf(
'd'.code.toByte(),
'o'.code.toByte(),
'n'.code.toByte(),
'e'.code.toByte(),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class AsyncDeviceMonitorRequestTest {
}

val updates = client.execute(AsyncDeviceMonitorRequest(), scope = this)
var update = updates.receiveOrNull()
var update = updates.receiveCatching().getOrNull()
assertThat(update!!).containsExactly(Device("emulator-5554", DeviceState.OFFLINE))
update = updates.receiveOrNull()
update = updates.receiveCatching().getOrNull()
assertThat(update!!).containsExactly(Device("emulator-5554", DeviceState.DEVICE))
updates.cancel()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CompatPullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CompatPushFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down Expand Up @@ -96,7 +96,7 @@ class CompatPushFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down Expand Up @@ -116,7 +116,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down Expand Up @@ -150,7 +150,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()
}
Expand Down Expand Up @@ -179,7 +179,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()
}
Expand Down Expand Up @@ -210,7 +210,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class PushFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down Expand Up @@ -102,7 +102,7 @@ class PushFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down Expand Up @@ -122,7 +122,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}

assertThat(progress).isEqualTo(1.0)
Expand Down Expand Up @@ -156,7 +156,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()
}
Expand Down Expand Up @@ -186,7 +186,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()
}
Expand Down Expand Up @@ -217,7 +217,7 @@ class PullFileRequestTest {

var progress = 0.0
while (!execute.isClosedForReceive) {
progress = execute.receiveOrNull() ?: break
progress = execute.receiveCatching().getOrNull() ?: break
}
}.join()
}
Expand Down
Loading