Skip to content

Commit

Permalink
配置本地依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
byhook committed Mar 26, 2019
1 parent 9c5fe35 commit 3f045c1
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 203 deletions.
26 changes: 12 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'

//构建版本
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
//默认的配置
defaultConfig {
applicationId "com.onzhou.module"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
applicationId rootProject.ext.android.applicationId

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -24,10 +26,7 @@ repositories {
jcenter()
maven {
//替换自己搭建的私服
url "http://127.0.0.1:8081/nexus/content/repositories/releases"
}
flatDir {
dirs 'libs'
url uri("/home/byhook/android/maven")
}
}

Expand All @@ -44,7 +43,6 @@ dependencies {
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'

//compile(name: 'merge-release', ext: 'aar')
//先在merge目录下执行合并gradle clean asR,右侧栏目gradle选择发布到maven,再进行依赖
compile 'com.onzhou.module:merge:1.0.1'

}
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: "config.gradle"

buildscript {

repositories {
maven {
//替换自己搭建的私服
url "http://127.0.0.1:8081/nexus/content/repositories/releases"
//替换自己搭建的私服 如: http://127.0.0.1:8081/nexus/content/repositories/releases
url uri("/home/byhook/android/maven")
}
jcenter()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
maven {
//替换自己搭建的私服
url "http://127.0.0.1:8081/nexus/content/repositories/releases"
url uri("/home/byhook/android/maven")
}
jcenter()
mavenCentral()
jcenter()
}
}

Expand Down

This file was deleted.

22 changes: 22 additions & 0 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ext {
android = [
compileSdkVersion: 25,
buildToolsVersion: "25.0.3",
applicationId : "com.onzhou.module",
minSdkVersion : 16,
targetSdkVersion : 25,
versionCode : 1,
versionName : "1.0.0",

//是否开启测试环境
MODE_DEBUG : false
]

dependencies = [
"design" : 'com.android.support:design:25.3.1',
"appcompat-v7": 'com.android.support:appcompat-v7:25.3.1',
"multidex" : "com.android.support:multidex:1.0.1",
"junit" : 'junit:junit:4.12'
]

}

This file was deleted.

17 changes: 8 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

## Project-wide Gradle settings.
#
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Tue Mar 26 15:43:26 CST 2019
org.gradle.jvmargs=-Xmx1536m

This file was deleted.

This file was deleted.

27 changes: 14 additions & 13 deletions module.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'

//构建版本
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
//默认的配置
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -28,10 +30,9 @@ repositories {

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'

testCompile rootProject.ext.dependencies["junit"]

compile rootProject.ext.dependencies["appcompat-v7"]
compile rootProject.ext.dependencies["design"]
}
8 changes: 5 additions & 3 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ publishing {
}
repositories {
maven {
url "http://127.0.0.1:8081/nexus/content/repositories/releases"
credentials {
//远程maven仓库的地址如: http://127.0.0.1:8081/nexus/content/repositories/releases
url uri("/home/byhook/android/maven")
//远程仓库需要配置密钥
/*credentials {
username "admin"
password "haoadmin"
}
}*/
}
}
}
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 3f045c1

Please sign in to comment.