GithubHelp home page GithubHelp logo

stefma / androidartifacts Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 5.0 410 KB

A super easy way to create Android and Java artifacts.

Home Page: https://androidartifacts.now.sh

License: Apache License 2.0

Kotlin 98.33% Java 1.67%
android bintray bintrayupload maven maven-plugin

androidartifacts's People

Contributors

passsy avatar stefma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

androidartifacts's Issues

Milestone 2.0

This issue is for tracking the Milestone 2 only:

  • #39
  • #49
  • #37
  • #18
  • Support only Gradle 4.6 and up(?)
  • Update AGP to 3.2.0 (check that first: #55 )
  • #69

Move to kotlin

Currently everything is developed in groovy.
I think it make sense to move it to kotlin. :)

Add `property` section to README

In #67 we increased the properties and especially the complexiety of the project.
We have to update the README with a "property" section which explains each of them...

Move the 'now' tasks into the buildSrc

Currently there is a lot of "overhead" inside the build.gradle.kts which setup some tasks about publishing the docs to zeit/now:

// Section for preparing to publish the docs to now.sh
tasks.create("moveDocsToNow", MoveDokkaAndGradleSiteToNow::class.java) {
dependsOn("dokka", "generateSite")
}
tasks.create("createNowDockerfile", CreateNowDockerfile::class.java)
tasks.create("createNowEntrypoint", CreateNowEntrypointIndexHtml::class.java)
tasks.create("createNowJson", CreateNowJson::class.java)
// This task requires a valid now-cli installation...
// Alternatively you can put a now token via gradle properties in.
tasks.create("publishDocsToNow") {
dependsOn("moveDocsToNow", "createNowDockerfile", "createNowEntrypoint", "createNowJson")
doLast {
exec {
workingDir("$buildDir/now")
val token = findProperty("nowToken")
if (token != null) {
commandLine("now", "--public", "--token", token)
} else {
// Try to run without token...
commandLine("now", "--public")
}
}
}
}
tasks.create("createNowAlias") {
dependsOn("publishDocsToNow")
doLast {
exec {
workingDir("$buildDir/now")
val token = findProperty("nowToken")
if (token != null) {
commandLine("now", "alias", "--token", token)
} else {
// Try to run without token...
commandLine("now", "alias")
}
}
}
}
// Section end

Move all the stuff into the buildSrc/.
The best solution would be to provide a our own Gradle Plugin for that...

Ignore applying sequence

The plugin should be applicable however when it is applied.

Currently the plugin needs to be applied after the com.android.library plugin & the org.jetbrains.kotlin plugin.
Which is a bad behaviour.
We should change that so that the plugin can be applied as "first" plugin too...

Missing sources

The sources of this lib aren't published to bintray.

Could not find androidartifacts-sources.jar (guru.stefma.androidartifacts:androidartifacts:1.0.0).
Searched in the following locations:
    https://jcenter.bintray.com/guru/stefma/androidartifacts/androidartifacts/1.0.0/androidartifacts-1.0.0-sources.jar

It would be very helpful when I could see the source in my IDE to debug bugs

That's what I currently see:
zd6sariydc

React on dokka plugin

Currently we blindly apply the dokka (or dokka-android) plugin when we detect a Kotlin module.

Instead of this we should react on the dokka plugin.

If it's applied, create the Kdoc. Otherwise don't.

Sent from my Nexus 5X using FastHub

Download/use Dokka-dependency only when needed

We ship the dokka (and dokka-android) plugin as dependency together with this plugin.
This is a bad behaviour.

In this Gradle guide states that we can download the dependency later somehow...

We should do that and only download them when required...

Work with kotlin

Some guys reported that this lib don't work with kotlin. Try that out and fix it .

This repo work with kotlin...

Javadocs are not correct

The javadocs are not hundred percent correct.
It generates something like this:
bildschirmfoto 2018-07-19 um 09 19 04
instead of this:
bildschirmfoto 2018-07-19 um 09 19 13

This is a possible "issue" with external dependencies which should be added to the javadoc "options"

options {
            links = ["http://docs.oracle.com/javase/7/docs/api/", "http://reactivex.io/RxJava/2.x/javadoc/"]
}

Don't know how to fix that...

Beside of this the @android.support.annotation.NonNull annotation don't get added.
I don't know which kind of error this is but that should be fixed:
Required:
bildschirmfoto 2018-07-19 um 09 40 46
Currently:
bildschirmfoto 2018-07-19 um 09 40 13

Missing compileOnly dependencies

I have dependencies added with compileOnly which should result in a dependency node in pom with scope = provided.
The dependency is missing at all.

Fix POM and tests

The POM is not correctly.
I talked with Stephan Oehme (Gradle Core Dev) in slack about it.

The Gradle configurations should be mapped in the following way into the POM:
bildschirmfoto 2018-07-23 um 07 44 16
&
bildschirmfoto 2018-07-20 um 15 06 34

Tests:

Beside of it the tests are where I check the "POM correctly" are bad.
We should check if the POM contain everything in the same order. Otherwise they check a different version-tag in the POM

React on applied plugins

In #27 we have created three different plugins.
Now we should provide one single entrypoint plugin which should react on the applied plugins.
That mean that the plugin should detect if either of the "generation plugin" is applied and should then pick (and apply) the correct provided plugin...

License lambda requires gradle 4.10

The license lambda requires a min version of gradle 4.10 when using kotlin to work as documented. See SAM conversion for Kotlin functions

Action<LicenseSpec> can't be converted automatically and results in this error:

license {
        ^ Type mismatch: inferred type is () -> Unit but Action<LicenseSpec> was expected

Workaround:

    license(Action{
        name = "Apache License, Version 2.0"
		// ...
    })

The workaround is less appealing but it works. Maybe this helps someone else running into this problem.

Plugin don't create android-sources, javadoc and pom-default

Sometimes, I don't know exactly in which cases, the following files won't be created:

  • myLibName-sources.jar (located in myLibName/build/libs/)
  • myLibName-javadoc.jar (located in myLibName/build/libs/)
  • pom-default.xml (located in myLibName/build/publications/release/)

To manually created it we can run the following task (same order like above):

  • [release]AndroidSourcesJar
  • [release]AndroidJavadocsJar
  • generatePomFileFor[Release]Publication

The final (and maybe always working) gradle-wrapper command would be:

./gradlew clean build releaseAndroidSourcesJar releaseAndroidJavadocsJar generatePomFileForReleasePublication artifactoryPublish

Think how to proceed here.
Maybe add dependencies to artifactoryPublish tha it should run after the other tasks...

Add support for POM name, desc and url for pre 4.8

Currently we have this todo:

// TODO add meta information using `pom.withXml { }`
if (extension.name != null) logger.warn(
"property 'name' of artifact '${extension.artifactId}' is not supported, please upgrade to Gradle 4.8+")
if (extension.description != null) logger.warn(
"property 'description' of artifact '${extension.artifactId}' is not supported, please upgrade to Gradle 4.8+")
if (extension.url != null) logger.warn(
"property 'url' of artifact '${extension.artifactId}' is not supported, please upgrade to Gradle 4.8+")

This should be solved

Provide plugins for different projects

We should provide three different plugins:

  • Android
  • Java
  • Kotlin

Each of them could be applied like they want.
But they require that at least the corresponding "generate" plugin is already applied. The plugins above requires at last the following plugins (in the same order):

  • com.android.library
  • org.gradle.java-library
  • org.jetbrains.kotlin.jvm

Switch to `tasks.register` and `tasks.named`

Currently we use tasks.create and getByName() for getting tasks.
We should switch to the register and named function.

This is a breaking change!
It is available in Gradle 4.9+ only!

Create `guru.stefma.artifacts` plugin which picks the correct plugin

This plugin ships two different plugins:
The guru.stefma.androidartficats and the guru.stefma.javaartifacts plugin.
The first one has to be used when we are in an android project.
The second one has to be used when we are in an java or kotlin project.
The downsides of these are, that a consumer has to pick the correct plugin. Otherwise the build will probably fail.

Provide a new plugin called guru.stefma.artifacts which just pick the correct plugin and apply it.
Make use of the pluginManager.withPlugin() {}.

Publish kdoc and Gradle sites

Publish the kdoc for this project.
Also publish the Gradle "information" via the Gradle Site Plugin.

I think the best solution would be to deploy everything to a github page.
But this should be done automatically. I don't know how to commit/push directly to a github branch in this project.
A easier solution would be to deply the docs to now.sh via a static Dockerfile.

Multiproject: artifactId is wrong in POM

When we have a multi module project and name the artifactId different than the Project#name the generated POM file will pick the Project#name instead of the artifactId.

// settings.gradle

include(":libA", ":libB")

// libA

artifactId = "core"

// libB

artifactId = "internal

dependencies {
  implementation(project(":libA"))

The POM of libB will use libA as artifactId instead of core

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.