weixin_39805087
2020-12-30 12:16 阅读 1

Gradle build and maven, downloadable jar

Great library, mind adding to maven central repository? a downloadable jar would be handy too. Also, I can't find a build script(gradle or maven) in the project, so i assume that you are using ADT's build feature. I would recommend migrating to maven/gradle if possible.

Thanks

该提问来源于开源项目:evgenyneu/js-evaluator-for-android

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

13条回答 默认 最新

  • weixin_39904809 weixin_39904809 2020-12-30 12:16

    Hi . Thanks for feedback. Believe it or not, I have not heard about gradle or maven. I will Google around, thanks.

    Please forgive my ignorance, I am only 3 months into Android and Java development. I used Eclipse which built the JAR automatically. To be honest, I am not very happy with Eclipse and today downloaded Android Studio. Let's see how it goes.

    点赞 评论 复制链接分享
  • weixin_39805087 weixin_39805087 2020-12-30 12:16

    No problem, if you want, I can create a patch with maven pom(the build file for maven) If you use Eclipse, you will have to install android maven plugin and convert your project to a maven project. you can read more here: https://code.google.com/p/maven-android-plugin/wiki/GettingStarted I'm still learning how to use Android Studio too....

    点赞 评论 复制链接分享
  • weixin_39805087 weixin_39805087 2020-12-30 12:16

    A pom.xml with something like this in your project root would work :) (this uses android-sdk-deployer for the android dependency, you can replace it with something that's already on the central repository to make life easier)

    
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelversion>4.0.0</modelversion>
        <groupid>com.evgenii.jsevaluator</groupid>
        <artifactid>jsevaluator</artifactid>
        <version>0.0.1-SNAPSHOT</version>
        <dependencies>
             <dependency>
                <groupid>android</groupid>
                <artifactid>android</artifactid>
                <version>4.4.2_r3</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
            <build>
            <sourcedirectory>src</sourcedirectory>
            <plugins>
                <plugin>
                    <groupid>org.apache.maven.plugins</groupid>
                    <artifactid>maven-compiler-plugin</artifactid>
    
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <showwarnings>true</showwarnings>
                    </configuration>
                </plugin>
                <plugin>
                    <groupid>com.jayway.maven.plugins.android.generation2</groupid>
                    <artifactid>android-maven-plugin</artifactid>
                    <version>3.9.0-rc.1</version>
                    <configuration>
                        <sdk>
                            <platform>19</platform>
                        </sdk>
                        <dexoptimize>false</dexoptimize>
                        <dex>
                            <predex>true</predex>
                            <predexliblocation>/tmp/predexedLibs</predexliblocation>
                        </dex>
                    </configuration>
                </plugin>
            </plugins>
            <pluginmanagement>
                <plugins>
                    <plugin>
                        <groupid>com.jayway.maven.plugins.android.generation2</groupid>
                        <artifactid>android-maven-plugin</artifactid>
                        <goals>
                            <goal>consume-aar</goal>
                        </goals>
                        <extensions>true</extensions>
                    </plugin>
                </plugins>
            </pluginmanagement>
        </build>
    </project>
    
    点赞 评论 复制链接分享
  • weixin_39904809 weixin_39904809 2020-12-30 12:16

    Added downloadable JAR. Added link to it in readme.

    点赞 评论 复制链接分享
  • weixin_39904809 weixin_39904809 2020-12-30 12:16

    Thanks for your help . I would like to use Android Studio in the future instead of Eclipse. As far as I know AS uses gradle and not maven by default. If that's try I will migrate the project from Eclipse to Android Studio so it has gradle file. I need to make sure I can easily run all the tests from gradle command line as well. What do you think?

    点赞 评论 复制链接分享
  • weixin_39966602 weixin_39966602 2020-12-30 12:16

    yeah, migrate the project to Android studios is a great idea, but even a better idea is actually to add it to Maven. :+1: for this!

    点赞 评论 复制链接分享
  • weixin_39661780 weixin_39661780 2020-12-30 12:16

    Hi all. It's also available as a Gradle/Maven dependency from https://jitpack.io/#evgenyneu/js-evaluator-for-android/ba07978dd3

    点赞 评论 复制链接分享
  • weixin_39904809 weixin_39904809 2020-12-30 12:16

    -io 👏thanks

    点赞 评论 复制链接分享
  • weixin_39661780 weixin_39661780 2020-12-30 12:16

    No problem : ) Would be also nice to have a GitHub release so that we could use that version

    点赞 评论 复制链接分享
  • weixin_39904809 weixin_39904809 2020-12-30 12:16

    -io I've added the version tag.

    点赞 评论 复制链接分享
  • weixin_39661780 weixin_39661780 2020-12-30 12:16

    Works great! https://jitpack.io/#evgenyneu/js-evaluator-for-android/v0.1.0

    点赞 评论 复制链接分享
  • weixin_39966602 weixin_39966602 2020-12-30 12:16

    very nice! thanks :+1:

    点赞 评论 复制链接分享
  • weixin_39904809 weixin_39904809 2020-12-30 12:16

    Closing this issue, there is a downloadable jar and maven setup now. As usual, feel free to reopen when needed.

    点赞 评论 复制链接分享

相关推荐