Comments (7)
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.
@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.
That's a good idea
from android-maven-plugin.
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.
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.
sweet =)
from android-maven-plugin.
Fix merged
from android-maven-plugin.
Related Issues (20)
- Release 4.6.0 HOT 10
- Q: does it support consumer proguard files in libraries?
- Support Request: JAR application needs code packaged in AAR HOT 5
- This version of the Play Developer API is no longer available HOT 2
- Various complications with Java 13 HOT 6
- Confusion about how the plugin starts d8 HOT 6
- Question about android app bundle format HOT 1
- maven central HOT 1
- A required class was missing javax/xml/bind/annotation/XmlSchema HOT 2
- libraryprojects-aar1 failing to build HOT 1
- AAR library examples using maven version 4.4.1
- extractduplicates HOT 2
- Some of the androidx libraries require AAPT2 in order to compile
- [4.6.0] NPE when trying to call getAndroidTargetManager
- Hello! we found a vulnerable dependency in your project.
- Trying to use d8 compiler gives error about no main manifest attribute found in jar HOT 1
- Error reading C:\Users\user\AppData\Local\Android\Sdk\tools\source.properties
- createMarshaller error
- java.lang.NoSuchMethodError: No static method metafactory
- manifest-merger fails with "FeatureName must follow"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-maven-plugin.