diff --git a/androiddemo/.gitignore b/androiddemo/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/androiddemo/.gitignore @@ -0,0 +1 @@ +/build diff --git a/androiddemo/build.gradle b/androiddemo/build.gradle new file mode 100644 index 0000000..7009115 --- /dev/null +++ b/androiddemo/build.gradle @@ -0,0 +1,45 @@ +apply plugin: 'com.android.library' +apply plugin: 'maven' +uploadArchives { + repositories { + mavenDeployer { + pom.groupId = POM_GROUP_ID + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + repository(url: POM_URL) { + authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD) + } + } + } +} +android { + compileSdkVersion 29 + buildToolsVersion "29.0.2" + + + defaultConfig { + minSdkVersion 21 + 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' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'androidx.appcompat:appcompat:1.1.0' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:runner:1.2.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' +} diff --git a/androiddemo/gradle.properties b/androiddemo/gradle.properties new file mode 100644 index 0000000..75c32f4 --- /dev/null +++ b/androiddemo/gradle.properties @@ -0,0 +1,27 @@ +# nexus服务器登陆时候的用户名/密码 +NEXUS_USERNAME=key +NEXUS_PASSWORD=123456 +# 在POM文件中使用的group ID +POM_GROUP_ID=com.duqijian.test +# POM文件中指向你网站的地址 +POM_URL=http://localhost:8081/repository/duqijian/ +# SCM是指版本管理工具 +POM_SCM_URL=http://localhost:8081/repository/duqijian/ +POM_SCM_CONNECTION=http://localhost:8081/repository/duqijian/ +POM_SCM_DEV_CONNECTION=http://localhost:8081/repository/duqijian/ +#POM_LICENCE_NAME= BSD License +POM_LICENCE_DIST=repo +# 开发者的相关信息 +POM_DEVELOPER_ID=duqijain +POM_DEVELOPER_NAME=duqijain + +# 库名称 +POM_NAME=androidDemo +# artifactId +POM_ARTIFACT_ID=key +# 库的打包格式为aar, 常见的还有jar +POM_PACKAGING=aar +# 库的描述,说明他是干啥的 +POM_DESCRIPTION=ceshi +# 要发布的版本好,snapshots 版本可以使用格式 1.0.0-SNAPSHOT +VERSION_NAME=1.0.0 \ No newline at end of file diff --git a/androiddemo/proguard-rules.pro b/androiddemo/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/androiddemo/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/androiddemo/src/androidTest/java/com/example/androiddemo/ExampleInstrumentedTest.java b/androiddemo/src/androidTest/java/com/example/androiddemo/ExampleInstrumentedTest.java new file mode 100644 index 0000000..cc29a4d --- /dev/null +++ b/androiddemo/src/androidTest/java/com/example/androiddemo/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.example.androiddemo; + +import android.content.Context; + +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("com.example.androiddemo.test", appContext.getPackageName()); + } +} diff --git a/androiddemo/src/main/AndroidManifest.xml b/androiddemo/src/main/AndroidManifest.xml new file mode 100644 index 0000000..7ffeb0f --- /dev/null +++ b/androiddemo/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/androiddemo/src/main/res/values/strings.xml b/androiddemo/src/main/res/values/strings.xml new file mode 100644 index 0000000..f044675 --- /dev/null +++ b/androiddemo/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + androidDemo + diff --git a/androiddemo/src/test/java/com/example/androiddemo/ExampleUnitTest.java b/androiddemo/src/test/java/com/example/androiddemo/ExampleUnitTest.java new file mode 100644 index 0000000..58927b7 --- /dev/null +++ b/androiddemo/src/test/java/com/example/androiddemo/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.example.androiddemo; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 1c82615..e1cbfae 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,19 +1,20 @@ apply plugin: 'com.android.application' +apply plugin: 'maven' android { useLibrary 'org.apache.http.legacy' - compileSdkVersion m_config.COMPILE_SDK_VERSION - compileSdkVersion 29 - buildToolsVersion "29.0.2" + compileSdkVersion m_config.COMPILE_SDK_VERSION + buildToolsVersion m_config.BUILD_TOOLS_VERSION + dataBinding { enabled = true } defaultConfig { applicationId "com.example.keyframework" - minSdkVersion 21 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" + minSdkVersion m_config.MIN_SDK_VERSION + targetSdkVersion m_config.TARGET_SDK_VERSION + versionCode m_config.VERSION_CODE + versionName m_config.VERSION_NAME testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" compileOptions { sourceCompatibility m_config.JAVA_VERSION diff --git a/build.gradle b/build.gradle index 798fab5..43e01ea 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ allprojects { google() jcenter() maven { url "https://jitpack.io" } + maven { url "http://localhost:8081/repository/duqijian/" } mavenCentral() maven { url 'https://dl.bintray.com/umsdk/release' } } diff --git a/gradle.properties b/gradle.properties index 199d16e..c73d239 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,4 +17,3 @@ org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true - diff --git a/gradle_component/dependencys.gradle b/gradle_component/dependencys.gradle index 6ba4577..a7da6fa 100644 --- a/gradle_component/dependencys.gradle +++ b/gradle_component/dependencys.gradle @@ -6,11 +6,11 @@ ext { ] m_config = [ - VERSION_CODE : 100, + VERSION_CODE : 1, VERSION_NAME : "1.0.0", KOTLIN_VERSION : '1.3.0', - COMPONENT_VERSION : '27.1.1', - COMPILE_SDK_VERSION: 28, + COMPONENT_VERSION : '23.1.1', + COMPILE_SDK_VERSION: 23, BUILD_TOOLS_VERSION: '28.0.3', MIN_SDK_VERSION : 16, TARGET_SDK_VERSION : 28, diff --git a/settings.gradle b/settings.gradle index 7031f72..5f9dee2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':base:tools', 'component', 'gradle_component', ':jpush' +include ':app', ':base:tools', ':androiddemo', 'component', 'gradle_component', ':jpush'