Skip to content

Commit

Permalink
Compile against SDK v8.0 and fix import breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
Windwoes committed Sep 14, 2022
1 parent 8ad0b78 commit c042a38
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion easyopencv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ android {
dependencies {
//compileOnly fileTree(include: ['*.aar'], dir: '../libs')
api 'org.openftc:opencv-repackaged:4.5.3-B'
compileOnly 'org.firstinspires.ftc:RobotCore:7.0.0'
compileOnly 'org.firstinspires.ftc:RobotCore:8.0.0'
}

apply from: '../sonatype-publish.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
package org.openftc.easyopencv;

import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.OpModeManagerImpl;
import com.qualcomm.robotcore.eventloop.opmode.OpModeManagerNotifier;

import org.firstinspires.ftc.robotcore.internal.opmode.OpModeManagerImpl;
import org.firstinspires.ftc.robotcore.internal.system.AppUtil;

import java.util.Stack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import com.qualcomm.robotcore.eventloop.EventLoopManager;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.OpModeManagerImpl;
import com.qualcomm.robotcore.eventloop.opmode.OpModeManagerNotifier;
import com.qualcomm.robotcore.robot.RobotState;
import com.qualcomm.robotcore.util.ElapsedTime;
Expand All @@ -46,7 +47,6 @@
import org.firstinspires.ftc.robotcore.external.function.ContinuationResult;
import org.firstinspires.ftc.robotcore.external.stream.CameraStreamServer;
import org.firstinspires.ftc.robotcore.external.stream.CameraStreamSource;
import org.firstinspires.ftc.robotcore.internal.opmode.OpModeManagerImpl;
import org.firstinspires.ftc.robotcore.internal.system.AppUtil;
import org.opencv.android.Utils;
import org.opencv.core.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@

package org.openftc.easyopencv;

import android.content.Context;
import android.content.pm.PackageManager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.qualcomm.robotcore.eventloop.opmode.AnnotatedOpModeManager;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.eventloop.opmode.OpModeRegistrar;

import org.firstinspires.ftc.robotcore.external.ClassFactory;
import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName;
Expand All @@ -43,8 +40,8 @@
class OpenCvCameraFactoryImpl extends OpenCvCameraFactory
{
private static int appVersion = -1;
private static int sdk6_1_versionCode = 39;
private static String sdk_6_1 = "6.1";
private static int sdk_8_0_versionCode = 47;
private static String sdk_8_0 = "8.0";

static
{
Expand All @@ -60,9 +57,9 @@ class OpenCvCameraFactoryImpl extends OpenCvCameraFactory

private void throwIfIncompatibleSdkVersion()
{
if(appVersion < sdk6_1_versionCode)
if(appVersion < sdk_8_0_versionCode)
{
throw new RuntimeException(String.format("EasyOpenCV v%s is only compatible with SDK v%s or greater!", BuildConfig.VERSION_NAME, sdk_6_1));
throw new RuntimeException(String.format("EasyOpenCV v%s is only compatible with SDK v%s or greater!", BuildConfig.VERSION_NAME, sdk_8_0));
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ android {

dependencies {
//implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly 'org.firstinspires.ftc:RobotCore:6.2.1'
compileOnly 'org.firstinspires.ftc:RobotCore:8.0.0'
compileOnly project(':easyopencv')
}

0 comments on commit c042a38

Please sign in to comment.