Skip to content

Commit

Permalink
add rx2
Browse files Browse the repository at this point in the history
  • Loading branch information
yale8848 committed Nov 29, 2017
1 parent 943c11f commit 8b35abf
Show file tree
Hide file tree
Showing 33 changed files with 168 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ android {

dependencies {

implementation project(':retrofitcachelibRX1')
implementation 'io.reactivex:rxjava:1.2.4'
implementation project(':retrofitcachelib')
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'

implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
implementation 'com.squareup.okio:okio:1.11.0'



implementation 'com.alibaba:fastjson:1.1.55.android'
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=file:///C:/YaleSoftFiles/Develop/gradle-4.2.1-all.zip
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions retrofitcachelibrx2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
38 changes: 38 additions & 0 deletions retrofitcachelibrx2/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 26



defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'

implementation'io.reactivex.rxjava2:rxjava:2.0.7'
implementation'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation'com.squareup.retrofit2:retrofit:2.2.0'
implementation'com.squareup.retrofit2:converter-gson:2.2.0'
implementation'com.squareup.retrofit2:adapter-rxjava2:2.2.0'

}
apply from: './config/RetrofitCache.gradle'
78 changes: 78 additions & 0 deletions retrofitcachelibrx2/config/RetrofitCache.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@

//jcenter upload
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'


version = '0.0.1'

repositories {
jcenter()
}
def siteUrl = 'https://github.com/yale8848/RetrofitCache' // 项目的主页
def gitUrl = 'https://github.com/yale8848/RetrofitCache.git' // Git仓库的url

group = "ren.yale.android"
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'retrofitcacherx2' //项目描述
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'Yale' //填写的一些基本信息
name 'Yale'
email 'royal8848@163.com'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
options.encoding = "utf-8"
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
//archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
name = "retrofitcacherx2" //发布到JCenter上的项目名字
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
21 changes: 21 additions & 0 deletions retrofitcachelibrx2/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions retrofitcachelibrx2/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.daoxuehao.android.retrofitcachelibrx2"/>
3 changes: 3 additions & 0 deletions retrofitcachelibrx2/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">retrofitcachelibRX2</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.daoxuehao.android.retrofitcachelibrx2;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app', ':retrofitcachelibRX1'
include ':app', ':retrofitcachelib', ':retrofitcachelibrx2'

0 comments on commit 8b35abf

Please sign in to comment.