Android 將項目上傳至github作爲庫引用

Android 將項目上傳至github作爲庫引用

1.新建一個Android 項目修改項目下的app.gradle文件

//apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
group='com.key.keylibrary'
android {
    compileSdkVersion 29
    defaultConfig {
  //      applicationId "com.key.keylibrary"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

2.上傳到gihub

步驟
3.在github上將項目創建一個引用
1).create releases
create releases
2).添加到JitPack並輸入項目地址即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章