chenFlyingkite / QQ

A library ready to be imported from other's build.gradle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QQ

QQ是一個可以成功 被 import 成 library 的小專案。 真是太感動了終於可以 import Library 了

使用Library 直接點開看

Syntax of README  =>     https://guides.github.com/features/mastering-markdown/

用 Android Studio 建一個 project. 然後選擇simple activity or no activity 然後把 名稱換成 library(非必要)

  1. 主要請看 QQ的
  • build.gradle : classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
//include ':app', ':logs'
include ':logs'
  1. logs (library name) 的
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group = 'com.github.chenFlyingkite'
 ...
dependencies {
   //compile fileTree(dir: 'libs', include: ['*.jar'])
   //compile 'com.android.support:appcompat-v7:26.+'
}
  1. 跟 QQ library 無關的 app (MainActivity.java)
apply plugin: 'com.android.application'
apply plugin: 'android-maven'

如果 app 要用到 logs,記得在 File > Project Structure

(左邊選 project) > (右邊有 Properties, Build Types, ...) 選 Dependencies > Add > Module Dependency

Image

  1. 引用 library 使用的 project : 參考 jitpack
  • 在 build.gradle 加上
allprojects {
    repositories {
        maven {
            url "https://jitpack.io" 
        }
    }
}
  • 在 yourLib/build.gradle 加上
dependencies { 
    ...
    //compile 'com.github.User:Repo:Tag'
    compile 'com.github.chenFlyingkite:QQ:0.0.1-2'
}

About

A library ready to be imported from other's build.gradle

License:Apache License 2.0


Languages

Language:Java 100.0%