Skip to content

Commit

Permalink
完善打包jar task, 使用:gradle makeJar
Browse files Browse the repository at this point in the history
  • Loading branch information
alexclin0188 committed Jan 31, 2016
1 parent 670a426 commit 939e16a
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ HttpLiteBuilder builder = MockLite.mock(new MockHandler() {
.useCookie(...) //设置CookieStore,设置则启用Cookie,不设置则不启用
.build();
httpLite.addResponseParser(new JacksonParser()); //添加ResponseParser实现结果解析
httpLite.setBaseUrl("http://192.168.99.238:10080/");
```

创建API接口实例
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp:okhttp:2.7.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.1'
compile 'com.google.code.gson:gson:2.5'
compile project(':httplite-urlconnection')
compile project(':httplite-okhttp2')
// compile project(':httplite-urlconnection')
// compile project(':httplite-okhttp2')
compile project(':mockdata')
}
Binary file added app/libs/httplite-oklite1.0_beta1.jar
Binary file not shown.
Binary file added app/libs/httplite-urlite1.0_beta1.jar
Binary file not shown.
Binary file added app/libs/httplite1.0_beta1.jar
Binary file not shown.
17 changes: 17 additions & 0 deletions httplite-okhttp2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,27 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':httplite')
compile 'com.squareup.okhttp:okhttp:2.7.0'
}

def VERSION_NAME = '1.0_beta1'
def JAR_NAME = 'httplite-oklite' +VERSION_NAME+'.jar'

task makeJar(type: Jar, dependsOn: ['build']) {
archiveName = JAR_NAME
from('build/intermediates/classes/release/')
destinationDir = file('build/outputs/libs/')
exclude('**/BuildConfig.class')
exclude('**/BuildConfig\$*.class')
exclude('**/R.class')
exclude('**/R\$*.class')
include('alexclin/httplite/**/*.class')
}
17 changes: 17 additions & 0 deletions httplite-urlconnection/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,26 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':httplite')
}

def VERSION_NAME = '1.0_beta1'
def JAR_NAME = 'httplite-urlite' +VERSION_NAME+'.jar'

task makeJar(type: Jar, dependsOn: ['build']) {
archiveName = JAR_NAME
from('build/intermediates/classes/release/')
destinationDir = file('build/outputs/libs/')
exclude('**/BuildConfig.class')
exclude('**/BuildConfig\$*.class')
exclude('**/R.class')
exclude('**/R\$*.class')
include('alexclin/httplite/**/*.class')
}
18 changes: 18 additions & 0 deletions httplite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,26 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

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

def VERSION_NAME = '1.0_beta1'
def JAR_NAME = 'httplite' +VERSION_NAME+'.jar'


task makeJar(type: Jar, dependsOn: ['build']) {
archiveName = JAR_NAME
from('build/intermediates/classes/release/')
destinationDir = file('build/outputs/libs/')
exclude('**/BuildConfig.class')
exclude('**/BuildConfig\$*.class')
exclude('**/R.class')
exclude('**/R\$*.class')
include('alexclin/httplite/**/*.class')
}
44 changes: 44 additions & 0 deletions httplite/src/main/java/alexclin/httplite/util/LiteCookieStore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package alexclin.httplite.util;

import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.URI;
import java.util.List;

/**
* LiteCookieStore
*
* @author alexclin
* @date 16/1/31 18:26
*/
public class LiteCookieStore implements CookieStore {
@Override
public void add(URI uri, HttpCookie cookie) {

}

@Override
public List<HttpCookie> get(URI uri) {
return null;
}

@Override
public List<HttpCookie> getCookies() {
return null;
}

@Override
public List<URI> getURIs() {
return null;
}

@Override
public boolean remove(URI uri, HttpCookie cookie) {
return false;
}

@Override
public boolean removeAll() {
return false;
}
}
Binary file added releaselib/httplite-oklite1.0_beta1.jar
Binary file not shown.
Binary file added releaselib/httplite-urlite1.0_beta1.jar
Binary file not shown.
Binary file added releaselib/httplite1.0_beta1.jar
Binary file not shown.

0 comments on commit 939e16a

Please sign in to comment.