forked from square/retrofit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request square#3635 from square/jw/robo/2021-09-20
Revert "Remove RoboVM Gradle plugin and test"
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
30 changes: 30 additions & 0 deletions
30
retrofit/robovm-test/src/main/java/retrofit2/RoboVmPlatformTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters