釋出aar到Github
第一步:
建立GIthub賬號,賬號不會建立的,哥也幫不了你,只能自行了斷了。
第二步:
在Github建立倉庫
看圖跟著學,高手略過。



第三步:
電腦上安裝Git 並且配置key(這裡就不講述怎麼配置了,度娘都有)
如果大家需要,我抽時間補上這個步驟,好不?
第四部:
克隆Git倉庫到本地
1.在電腦本第建立資料夾
這是我自己的。

2.開啟Git 輸入命令:cd \f\arr\yinshiping 回車 進入新建的檔案下

2.將本地倉庫初始化,命令:git init 如下圖

3.將你需要的專案從github或者伺服器上克隆下來,命令:git clone url url為專案伺服器地址或github地址,這裡我們克隆剛才在github新建的那個倉庫地址
點選下圖紅色標記處,可把地址複製下來。


看到上面顯示100%就克隆好了 現在看看克隆的專案
成功後會在剛才本地新建的資料夾下看到兩個這個的檔案

第五步:
開啟你的as 找到你要生成arr 的library 在 library 下的build.gradle末尾新增以下程式碼:
applyplugin:'maven'
ext {
// 從Github上clone下來的專案的本地地址
GITHUB_REPO_PATH ="F:\\arr\\yinshiping\\yinshipin"
PUBLISH_GROUP_ID ='com.yuxihai' //這個不要跟著我寫 這是github 的id
PUBLISH_ARTIFACT_ID ='yinshipin' //這個是剛才在github建立的倉庫名字
PUBLISH_VERSION ='1.0.0' //版本號
}
uploadArchives {
repositories.mavenDeployer {
def deployPath = file(project.GITHUB_REPO_PATH)
repository(url:"file://${deployPath.absolutePath}")
pom.project {
groupId project.PUBLISH_GROUP_ID
artifactId project.PUBLISH_ARTIFACT_ID
version project.PUBLISH_VERSION
}
}
}
// 原始碼一起打包(不需要打包原始碼的不要新增這幾行)
task androidSourcesJar(type: Jar) {
classifier ='sources'
from android.sourceSets.main.java.sourceFiles
}
artifacts {
archivesandroidSourcesJar
}
第六步:
打包上傳
看圖操作

輸入命令:gradlew uploadArchives 回車執行
出現綠色的地方 表示成功

本地檔案下多出來一個檔案如圖

上傳自己的專案到github上
大致可以分為四步add,commit,remote,push
add(選擇在倉庫裡將要新增的檔案)
$ gitadd. //(.代表要上傳此資料夾內所有的檔案。如果需要上傳指定檔案,指定檔名稱就可以)
如圖:

commit
$ git commit -m 'Test'//(m後面跟一個引數,表示說明,將程式碼提交到GitHub後,將會在程式碼檔案資訊上顯示這個說明,這個很重要)

remote
$ git remoteaddorigin URL //主義URL替換成自己github倉庫地址
有時候輸入這個語句的時候,github可能會”掉線”。會報fatal: remote origin already exists.這個錯誤。這時只需要輸入
$ git remote rm origin 再輸入上面的程式碼就可以了

最後一步push
$ git push-uorigin master//將本地專案更新到github專案上去


最後使用:
第一種:

再加上:compile 'com.github.yuxihai:yinshipin:V1.0.0'
第二種:
還是看圖吧





開啟:https://jitpack.io/


最後使用方式:

好了寫完了 不明白的可以評論或者私信,大家一起學習,努力成為頂級大神!
相關文章
- 【Android AAR】快速釋出 Android Library 專案到 JCenterAndroid
- Android library 釋出多渠道 AARAndroid
- Github Action釋出Github
- GitHub釋出重大更新,關係到所有程式設計師!Github程式設計師
- 使用CI/CD工具Github Action釋出jar到Maven中央倉庫GithubJARMaven
- 通過 Github Action 釋出 SpringBoot Docker 專案到雲伺服器GithubSpring BootDocker伺服器
- 使用 Github Action 釋出 Flutter 外掛GithubFlutter
- 利用github Actions釋出npm和releaseGithubNPM
- 利用 GitHub Action 自動釋出 DockerGithubDocker
- Docusaurus2 快速建站,釋出 GitHub PagesGithub
- AAR 檔案錯誤:Direct local .aar file dependencies are not supported when building an AAR.UI
- 使用 Github Actions 持續釋出 Flutter 應用GithubFlutter
- 用GitHub Actions自動釋出Hexo部落格GithubHexo
- vue外掛開發、文件書寫、github釋出、npm包釋出一波流VueGithubNPM
- 釋出.netcore到Centos7NetCoreCentOS
- 釋出一個 Github Trending 的API,並開源GithubAPI
- 使用 Github Action 進行前端自動化釋出Github前端
- 用 GitHub Actions 自動打包釋出 Python 專案GithubPython
- 讓Github暢通無阻,FastGithub1.0.0釋出GithubAST
- Flutter打包AAR外掛之fat-aar使用教程Flutter
- Flutter 如何建立併發布 Plugin (VS Code + GitHub 釋出)FlutterPluginGithub
- 基於 Probot 實現 GitHub NPM 釋出機器人?GithubNPM機器人
- 輕鬆釋出 react 元件到 npmReact元件NPM
- 上週 GitHub 熱點速覽 vol.07:GitHub 官方 CLI beta 版已釋出Github
- Go 部落格平臺 Pipe 1.8.2 釋出,支援 GitHub 登入GoGithub
- GitHub釋出改進開發工作流的新工具Github
- Vue外掛從封裝到釋出Vue封裝
- 釋出jar包到maven中央倉庫JARMaven
- flutter釋出專案到pub的流程Flutter
- GitHub迎來史上最大產品變革:釋出可直接執行程式碼的GitHub ActionsGithub行程
- 【Android AAR】1 分鐘不用改任何程式碼在 Eclipse 中使用 AARAndroidEclipse
- 【盜墓筆記】圖解使用fat-aar方式在AndroidStudio中打包巢狀第三方aar的aar筆記圖解Android巢狀
- GitHub Copilot for Business 正式釋出,重新定義開發生產力Github
- 提交程式碼到githubGithub
- Flutter 外掛開發之引入aar到安卓部分 並使用本地mavenFlutter安卓Maven
- android studio生成並引用aarAndroid
- Android Studio module 打aar包Android
- 原生Android工程接入Flutter aarAndroidFlutter