Ver Fonte

Fix to use new APIs and take advantage of build dependency fixes in the Android SDK r17.
Fix deprecated gradle APIs.

Damon Kohler há 13 anos atrás
pai
commit
7f505c7464

+ 1 - 3
android_acm_serial/build.gradle

@@ -14,7 +14,5 @@
  * the License.
  * the License.
  */
  */
 
 
-dependsOn ':android_honeycomb_mr2'
-
-debug.dependsOn deployLibs
+debug.dependsOn project(':android_honeycomb_mr2').tasks.debug
 
 

+ 0 - 2
android_gingerbread/build.gradle

@@ -18,5 +18,3 @@ dependencies {
   compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
   compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
 }
 }
 
 
-debug.dependsOn deployTransitiveLibs
-

+ 1 - 1
android_honeycomb_mr2/build.gradle

@@ -18,5 +18,5 @@ dependencies {
   compile 'ros.rosjava_core:rosjava_geometry:0.0.0-SNAPSHOT'
   compile 'ros.rosjava_core:rosjava_geometry:0.0.0-SNAPSHOT'
 }
 }
 
 
-debug.dependsOn project(':android_gingerbread').tasks.debug, deployLibs
+debug.dependsOn project(':android_gingerbread').tasks.debug
 
 

+ 1 - 1
android_tutorial_camera/build.gradle

@@ -14,5 +14,5 @@
  * the License.
  * the License.
  */
  */
 
 
-debug.dependsOn project(':android_gingerbread').tasks.debug, deployLibs
+debug.dependsOn project(':android_gingerbread').tasks.debug
 
 

+ 1 - 3
android_tutorial_hokuyo/build.gradle

@@ -14,11 +14,9 @@
  * the License.
  * the License.
  */
  */
 
 
-dependsOn ':android_acm_serial'
-
 dependencies {
 dependencies {
   compile 'ros.google:hokuyo:0.0.0-SNAPSHOT'
   compile 'ros.google:hokuyo:0.0.0-SNAPSHOT'
 }
 }
 
 
-debug.dependsOn deployLibs
+debug.dependsOn project(':android_acm_serial').tasks.debug
 
 

+ 1 - 3
android_tutorial_image_transport/build.gradle

@@ -14,7 +14,5 @@
  * the License.
  * the License.
  */
  */
 
 
-dependsOn ':android_gingerbread'
-
-debug.dependsOn deployLibs
+debug.dependsOn project(':android_gingerbread').tasks.debug
 
 

+ 3 - 4
android_tutorial_image_transport/src/org/ros/android/tutorial/image_transport/MainActivity.java

@@ -21,7 +21,6 @@ import org.ros.address.InetAddressFactory;
 import org.ros.android.BitmapFromCompressedImage;
 import org.ros.android.BitmapFromCompressedImage;
 import org.ros.android.RosActivity;
 import org.ros.android.RosActivity;
 import org.ros.android.views.RosImageView;
 import org.ros.android.views.RosImageView;
-import org.ros.message.sensor_msgs.CompressedImage;
 import org.ros.node.NodeConfiguration;
 import org.ros.node.NodeConfiguration;
 import org.ros.node.NodeMainExecutor;
 import org.ros.node.NodeMainExecutor;
 
 
@@ -31,7 +30,7 @@ import org.ros.node.NodeMainExecutor;
  */
  */
 public class MainActivity extends RosActivity {
 public class MainActivity extends RosActivity {
 
 
-  private RosImageView<CompressedImage> image;
+  private RosImageView<sensor_msgs.CompressedImage> image;
 
 
   public MainActivity() {
   public MainActivity() {
     super("ImageTransportTutorial", "ImageTransportTutorial");
     super("ImageTransportTutorial", "ImageTransportTutorial");
@@ -42,9 +41,9 @@ public class MainActivity extends RosActivity {
   public void onCreate(Bundle savedInstanceState) {
   public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
     setContentView(R.layout.main);
-    image = (RosImageView<CompressedImage>) findViewById(R.id.image);
+    image = (RosImageView<sensor_msgs.CompressedImage>) findViewById(R.id.image);
     image.setTopicName("/usb_cam/image_raw/compressed");
     image.setTopicName("/usb_cam/image_raw/compressed");
-    image.setMessageType("sensor_msgs/CompressedImage");
+    image.setMessageType(sensor_msgs.CompressedImage._TYPE);
     image.setMessageToBitmapCallable(new BitmapFromCompressedImage());
     image.setMessageToBitmapCallable(new BitmapFromCompressedImage());
   }
   }
 
 

+ 1 - 3
android_tutorial_pubsub/build.gradle

@@ -14,11 +14,9 @@
  * the License.
  * the License.
  */
  */
 
 
-dependsOn ':android_gingerbread'
-
 dependencies {
 dependencies {
   compile 'ros.rosjava_core:rosjava_tutorial_pubsub:0.0.0-SNAPSHOT'
   compile 'ros.rosjava_core:rosjava_tutorial_pubsub:0.0.0-SNAPSHOT'
 }
 }
 
 
-debug.dependsOn deployLibs
+debug.dependsOn project(':android_gingerbread').tasks.debug
 
 

+ 8 - 9
android_tutorial_pubsub/src/org/ros/android/tutorial/pubsub/MainActivity.java

@@ -32,7 +32,7 @@ import org.ros.tutorials.pubsub.Talker;
 public class MainActivity extends RosActivity {
 public class MainActivity extends RosActivity {
 
 
   private RosCore rosCore;
   private RosCore rosCore;
-  private RosTextView<org.ros.message.std_msgs.String> rosTextView;
+  private RosTextView<std_msgs.String> rosTextView;
   private Talker talker;
   private Talker talker;
 
 
   public MainActivity() {
   public MainActivity() {
@@ -44,16 +44,15 @@ public class MainActivity extends RosActivity {
   public void onCreate(Bundle savedInstanceState) {
   public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     super.onCreate(savedInstanceState);
     setContentView(R.layout.main);
     setContentView(R.layout.main);
-    rosTextView = (RosTextView<org.ros.message.std_msgs.String>) findViewById(R.id.text);
+    rosTextView = (RosTextView<std_msgs.String>) findViewById(R.id.text);
     rosTextView.setTopicName("/chatter");
     rosTextView.setTopicName("/chatter");
     rosTextView.setMessageType("std_msgs/String");
     rosTextView.setMessageType("std_msgs/String");
-    rosTextView
-        .setMessageToStringCallable(new MessageCallable<String, org.ros.message.std_msgs.String>() {
-          @Override
-          public String call(org.ros.message.std_msgs.String message) {
-            return message.data;
-          }
-        });
+    rosTextView.setMessageToStringCallable(new MessageCallable<String, std_msgs.String>() {
+      @Override
+      public String call(std_msgs.String message) {
+        return message.data();
+      }
+    });
   }
   }
 
 
   @Override
   @Override

+ 1 - 3
android_tutorial_teleop/build.gradle

@@ -14,7 +14,5 @@
  * the License.
  * the License.
  */
  */
 
 
-dependsOn ':android_honeycomb_mr2'
-
-debug.dependsOn deployLibs
+debug.dependsOn project(':android_honeycomb_mr2').tasks.debug
 
 

+ 2 - 7
build.gradle

@@ -37,13 +37,8 @@ subprojects {
       exclude group: 'xml-apis'
       exclude group: 'xml-apis'
     }
     }
 
 
-    task deployTransitiveLibs(type: Copy) {
-      from { configurations.compile }
-      into "${projectDir}/libs"
-    }
-
     task deployLibs(type: Copy) {
     task deployLibs(type: Copy) {
-      from { configurations.compile.copy().setTransitive(false) }
+      from { configurations.compile }
       into "${projectDir}/libs"
       into "${projectDir}/libs"
     }
     }
 
 
@@ -53,7 +48,7 @@ subprojects {
       ant.delete dir: "${projectDir}/libs"
       ant.delete dir: "${projectDir}/libs"
     }
     }
 
 
-    task debug(type: Exec) {
+    task debug(type: Exec, dependsOn: deployLibs) {
       commandLine 'ant', 'debug'
       commandLine 'ant', 'debug'
     }
     }
   }
   }