TimotheeJeannin / ProviGen

Easily make a ContentProvider from an annotated ContractClass.
MIT License
243 stars 27 forks source link

Mavenised #5

Closed Shusshu closed 10 years ago

Shusshu commented 11 years ago

I could add a readme with the following info:

<dependency> 
    <groupId>com.github.TimotheeJeannin</groupId> 
    <artifactId>ProviGen-lib</artifactId> 
    <version>1.5.1-SNAPSHOT</version> 
</dependency> 
Shusshu commented 11 years ago

You should really consider using maven for all your projects or at least let others use maven with your projects

arturdryomov commented 11 years ago

A new Android build system uses Gradle which peeks dependencies from Maven Cetral easily. So moving the library to Maven and Maven Central is a great idea. :+1:

Shusshu commented 11 years ago

Of course!

Shusshu commented 11 years ago

updated to have a nice diff

Shusshu commented 11 years ago

Is this ever going to be accepted? not for my sake as I use it already in my company repository but for others using maven or gradle.

TimotheeJeannin commented 11 years ago

I will probably move to a Gradle based build system. I'm also planning on publishing on Maven Central. I just need time. :)

Shusshu commented 11 years ago

You could support both, it's just a pom you know... Plus gradle does not support everything maven-android-plugin does

Benoit Billington

On Fri, May 24, 2013 at 11:50 PM, Timothée Jeannin <notifications@github.com

wrote:

I will probably move to a Gradle based build system. I'm also planning on publishing on Maven Central. I just need time. :)

— Reply to this email directly or view it on GitHubhttps://github.com/TimotheeJeannin/ProviGen/pull/5#issuecomment-18431997 .

hleinone commented 11 years ago

Not being on Maven Central is a major turn-off for any Android library. I'd definitely give this one a try if trying it was just one line to my build.gradle away, now I don't know if it's worth the juggle.

Shusshu commented 11 years ago

I use it all the time I have installed it into my company repository instead... but yes it's a real pitty not to have it in central

Benoit Billington

On Mon, Nov 4, 2013 at 2:22 PM, Hannu Leinonen notifications@github.comwrote:

Not being on Maven Central is a major turn-off for any Android library. I'd definitely give this one a try if trying it was just one line to my build.gradle away, now I don't know if it's worth the juggle.

— Reply to this email directly or view it on GitHubhttps://github.com/TimotheeJeannin/ProviGen/pull/5#issuecomment-27684124 .

TimotheeJeannin commented 10 years ago

Hi, I'm working on the Maven integration right now.

@Shusshu, I merged your changes in this branch: https://github.com/TimotheeJeannin/ProviGen/tree/feature-maven

Everything is working fine except that only InvalidContractsTest is run. It looks like maven only runs AndroidTestCase tests and no ProviderTestCase2 tests. I tried to change the maven plugin configuration without success:

<plugin>
    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <test>
            <skip>false</skip>
            <instrumentationPackage>com.tjeannin.provigen</instrumentationPackage>
            <!--<instrumentationRunner>className</instrumentationRunner>-->
            <debug>true</debug>
            <coverage>true</coverage>
            <createReport>true</createReport>
            <classes>
                <class>com.tjeannin.provigen.test.basis.SimpleContentProviderTest</class>
                <class>com.tjeannin.provigen.test.constraint.ConstraintsTest</class>
                <class>com.tjeannin.provigen.test.constraint.OnConflictTest</class>
                <class>com.tjeannin.provigen.test.contract.InvalidContractsTest</class>
                <class>com.tjeannin.provigen.test.multiple.MultipleContractContentTest</class>
            </classes>
            <!--<packages>
                <package>com.tjeannin.provigen</package>
            </packages>-->
        </test>
    </configuration>
</plugin>

Do you have any idea where the problem is coming from ?

Here is what I have when running a mvn install:

[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ ProviGen-tests ---
[INFO] Building jar: D:\EN_COURS\ApplicationsAndroid\git-repositories\ProviGenMavenRepo\ProviGenTests\target\ProviGen-tests-1.6.0.jar
[INFO] 
[INFO] --- android-maven-plugin:3.8.0:apk (default-apk) @ ProviGen-tests ---
[INFO] Enabling debug build for apk.
[INFO] D:\EN_COURS\ApplicationsAndroid\android-sdk-windows\build-tools\18.0.1\aapt.exe [package, -f, -M, D:\EN_COURS\ApplicationsAndroid\git-repositories\ProviGenMavenRepo\ProviGenTests\AndroidManifest.xml, -S, D:\EN_COURS\ApplicationsAndroid\git-repositories\ProviGenMavenRepo\ProviGenTests\res, --auto-add-overlay, -I, D:\EN_COURS\ApplicationsAndroid\android-sdk-windows\platforms\android-16\android.jar, -F, D:\EN_COURS\ApplicationsAndroid\git-repositories\ProviGenMavenRepo\ProviGenTests\target\ProviGen-tests-1.6.0.ap_, --debug-mode]
[INFO] 
[INFO] --- android-maven-plugin:3.8.0:internal-pre-integration-test (default-internal-pre-integration-test) @ ProviGen-tests ---
[INFO] Waiting for initial device list from the Android Debug Bridge
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 03042eda08e5ea29_LGE_Nexus5 found.
[INFO] 03042eda08e5ea29_LGE_Nexus5 :   Successfully installed D:\EN_COURS\ApplicationsAndroid\git-repositories\ProviGenMavenRepo\ProviGenTests\target\ProviGen-tests-1.6.0.apk to 03042eda08e5ea29_LGE_Nexus5
[INFO] 
[INFO] --- android-maven-plugin:3.8.0:internal-integration-test (default-internal-integration-test) @ ProviGen-tests ---
[INFO] Found 1 devices connected with the Android Debug Bridge
[INFO] android.device parameter not set, using all attached devices
[INFO] Device 03042eda08e5ea29_LGE_Nexus5 found.
[INFO] 03042eda08e5ea29_LGE_Nexus5 :   Running instrumentation tests in com.tjeannin.provigen.test
[INFO] 03042eda08e5ea29_LGE_Nexus5 :     Run started: com.tjeannin.provigen.test, 4 tests:
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       Start [1/4]: android.test.AndroidTestCase#testAndroidTestCaseSetupProperly
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       End [1/4]: android.test.AndroidTestCase#testAndroidTestCaseSetupProperly
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       Start [2/4]: android.test.LoaderTestCase#testAndroidTestCaseSetupProperly
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       End [2/4]: android.test.LoaderTestCase#testAndroidTestCaseSetupProperly
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       Start [3/4]: com.tjeannin.provigen.test.contract.InvalidContractsTest#testAndroidTestCaseSetupProperly
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       End [3/4]: com.tjeannin.provigen.test.contract.InvalidContractsTest#testAndroidTestCaseSetupProperly
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       Start [4/4]: com.tjeannin.provigen.test.contract.InvalidContractsTest#testInvalidContracts
[INFO] 03042eda08e5ea29_LGE_Nexus5 :       End [4/4]: com.tjeannin.provigen.test.contract.InvalidContractsTest#testInvalidContracts
[INFO] 03042eda08e5ea29_LGE_Nexus5 :     Run ended: 18 ms
[INFO]   Tests run: 4,  Failures: 0,  Errors: 0
[INFO] 03042eda08e5ea29_LGE_Nexus5 :   Report file written to D:\EN_COURS\ApplicationsAndroid\git-repositories\ProviGenMavenRepo\ProviGenTests\target\surefire-reports\TEST-03042eda08e5ea29_LGE_Nexus5.xml
Shusshu commented 10 years ago

You might have more luck if you ask on the Android Maven Plugin google groups: https://groups.google.com/forum/#!forum/maven-android-developers

Shusshu commented 10 years ago

If you are unsure about something else you can ask me and also compare my branch https://github.com/Shusshu/ProviGen/tree/shusshu-master

Btw you can mavenise it into your master branch and then focus and get help from others to get all tests working via maven

TimotheeJeannin commented 10 years ago

Thanks to @Shusshu and @BigMichi1, ProviGen should be available for download on Maven Central now.

Let me know if you're experiencing any issue.