Skip to content

Commit

Permalink
Merge pull request square#3635 from square/jw/robo/2021-09-20
Browse files Browse the repository at this point in the history
Revert "Remove RoboVM Gradle plugin and test"
  • Loading branch information
JakeWharton authored Sep 21, 2021
2 parents db10a78 + fc05cae commit 2a0c8c0
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,28 @@ jobs:
env:
API_LEVEL: ${{ matrix.api-level }}

robovm:
runs-on: macos-latest

steps:
- uses: actions/[email protected]
- uses: gradle/[email protected]

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8

- name: Run Tests
run: ./gradlew retrofit:robovm-test:robovmTest

publish:
runs-on: ubuntu-latest
if: github.repository == 'square/retrofit' && github.ref == 'refs/heads/master'
needs:
- jvm
- android
- robovm

steps:
- uses: actions/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
'protobuf': '3.17.3',
'jaxb': '2.3.1',
'jaxb3': '3.0.1',
'robovm': '2.3.14',
]
ext.deps = [
'kotlinStdLib': "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}",
Expand Down Expand Up @@ -37,6 +38,7 @@ buildscript {
'simpleXml': 'org.simpleframework:simple-xml:2.7.1',
'wireRuntime': 'com.squareup.wire:wire-runtime:2.2.0',
'jsoup': 'org.jsoup:jsoup:1.14.1',
'robovm': "com.mobidevelop.robovm:robovm-rt:${versions.robovm}",
]

dependencies {
Expand All @@ -48,6 +50,7 @@ buildscript {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0'
classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9'
classpath "com.mobidevelop.robovm:robovm-gradle-plugin:${versions.robovm}"
}
repositories {
mavenCentral()
Expand Down
20 changes: 20 additions & 0 deletions retrofit/robovm-test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apply plugin: 'java'
apply plugin: 'robovm'

ext.mainClassName = 'retrofit2.RoboVmPlatformTest'

robovm {
archs = 'x86_64'
}

dependencies {
implementation project(':retrofit')
implementation deps.robovm
}

task robovmTest(type: Exec) {
dependsOn {
robovmInstall
}
commandLine './build/robovm/retrofit2.RoboVmPlatformTest'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2020 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package retrofit2;

public final class RoboVmPlatformTest {
public static void main(String[] args) {
Platform platform = Platform.get();
if (platform.createDefaultCallAdapterFactories(null).size() > 1) {
// Everyone gets the callback executor adapter. If RoboVM was correctly detected it will NOT
// get the Java 8-supporting CompletableFuture call adapter factory.
System.exit(1);
}
}

private RoboVmPlatformTest() {
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include ':retrofit'
include ':retrofit:android-test'
include ':retrofit:robovm-test'
include ':retrofit:test-helpers'

include ':retrofit-mock'
Expand Down

0 comments on commit 2a0c8c0

Please sign in to comment.