Code Monkey home page Code Monkey logo

Comments (7)

william-ferguson-au avatar william-ferguson-au commented on May 19, 2024

NB to get this far you also need to have changed the scope of the APK dependency in libraryprojects-tests/POM.xml to provided. Eg

    <dependency>
      <groupId>com.jayway.maven.plugins.android.generation2.samples.libraryprojects</groupId>
      <artifactId>libraryprojects-apk-with-deps</artifactId>
      <version>${project.version}</version>
      <type>apk</type>
      <scope>provided</scope>
    </dependency>

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 19, 2024

@malachid suggested using isEnableIntegrationTest to determine whether it is an instrumentation test. A better approach is extractInstrumentationRunnerFromAndroidManifest(manifestFile) != null as we can call it from any AndroidMojo not just an InstrumentationMojo.

from android-maven-plugin.

malachid avatar malachid commented on May 19, 2024

That's a good idea

from android-maven-plugin.

malachid avatar malachid commented on May 19, 2024

We're moving the email thread to here....

I had noted that I got the tests to compile and run by changing the dependency to:

    <dependency>
      <groupId>com.jayway.maven.plugins.android.generation2.samples.libraryprojects</groupId>
      <artifactId>libraryprojects-apk-with-deps</artifactId>
      <version>${project.version}</version>
      <type>apk</type>
      <scope>provided</scope>
      <exclusions>
       <exclusion>
        <groupId>com.jayway.maven.plugins.android.generation2.samples.libraryprojects</groupId>
        <artifactId>libraryprojects-apklib-from-apklib</artifactId>
       </exclusion>
      </exclusions>
    </dependency>

Not ideal. With normal APK, we would include the source from APKLIB into the APK. With an instrumentation APK, we should not be embedding the classes from any of the dependencies.

The previous mentioned fix was regarding AAR classpath being setup, but unpacked_libs not existing. Now, the 'extract into unpacked_libs' (and no other step) is allowing provided scope.

I think we can fix this pretty easily and cleanly. We don't even need to look at the AndroidManifest. We normally extract the APKLIB and include it in the source set to compile. If the APKLIB is set to system|provided (actually our normal exclusion rules) we don't add it as a source set... Then normal APKLIBs that declare a chained dependency are still OK; APKs that declare an APKLIB dependency are still OK; but transitive APKLIBs coming from provided-scope APK will have the scope of provided and be ignored...?

from android-maven-plugin.

william-ferguson-au avatar william-ferguson-au commented on May 19, 2024

I got lost on how a APKLIB dep of an APK dep would not be included.

I actually have a solution that I am running through some final tests.
It build ands runs the samples end to end on the Dalvik runtime.

I just want to test it on @malachid's #358 test project.

from android-maven-plugin.

malachid avatar malachid commented on May 19, 2024

sweet =)

from android-maven-plugin.

mosabua avatar mosabua commented on May 19, 2024

Fix merged

from android-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.