Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chenenyu committed Jan 13, 2017
2 parents 2395d0b + bd94d04 commit 9439c63
Show file tree
Hide file tree
Showing 48 changed files with 671 additions and 183 deletions.
6 changes: 4 additions & 2 deletions annotation/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

Properties config = new Properties()
config.load(project.file('../publish_version.properties').newDataInputStream())
def VERSION = config.getProperty("ANNOTATION_VERSION")
def GROUP = 'com.chenenyu.router'
def ARTIFACT_ID = 'annotation'
def VERSION = '0.1.0'

group = GROUP
version = VERSION
Expand Down Expand Up @@ -48,7 +50,7 @@ bintray {
websiteUrl = 'https://github.com/chenenyu/Router'
issueTrackerUrl = 'https://github.com/chenenyu/Router/issues'
vcsUrl = 'https://github.com/chenenyu/Router.git'
desc = "Annotation compiler for Router library."
desc = "Annotation for Router library."
labels = ["Android", "Router", "annotation"]
licenses = ["Apache-2.0"]
publicDownloadNumbers = true
Expand Down
29 changes: 19 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
apply plugin: 'com.android.application'
apply plugin: 'com.chenenyu.router'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.chenenyu.router.demo"
minSdkVersion 14
targetSdkVersion 25
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

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

lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}

compileOptions {
sourceCompatibility rootProject.ext.sourceCompatibility
targetCompatibility rootProject.ext.targetCompatibility
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
annotationProcessor project(':compiler')
compile project(':router')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile "com.android.support:appcompat-v7:${rootProject.ext.supportVersion}"
compile 'com.android.support:multidex:1.0.1'
compile project(':module1')
compile project(':module2')
}
21 changes: 11 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chenenyu.router.demo">
<manifest package="com.chenenyu.router.demo"
xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand All @@ -11,30 +12,30 @@
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".TestActivity"
android:label="TestActivity" />
android:label="TestActivity"/>
<activity
android:name=".DynamicActivity"
android:label="DynamicActivity" />
android:label="DynamicActivity"/>
<activity
android:name=".ForResultActivity"
android:label="ForResultActivity" />
android:label="ForResultActivity"/>

<activity
android:name=".SchemeActivity"
android:label="SchemeActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data
android:host="host"
android:scheme="router" />
android:scheme="router"/>
</intent-filter>
</activity>
</application>
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/java/com/chenenyu/router/demo/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.chenenyu.router.demo;

import android.support.multidex.MultiDexApplication;

import com.chenenyu.router.Router;

/**
* <p>
* Created by Cheney on 2017/1/12.
*/
public class App extends MultiDexApplication {
@Override
public void onCreate() {
super.onCreate();
Router.initialize(this, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public class DynamicActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_not_annotated);
setContentView(R.layout.activity_dynamic);
}
}
4 changes: 0 additions & 4 deletions app/src/main/java/com/chenenyu/router/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ public void handleActivityTable(Map<String, Class<? extends Activity>> map) {
map.put("dynamic", DynamicActivity.class);
}
});

// 注册匹配规则
// Router.registerMatcher(new Matcher(0x10000));

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context="com.chenenyu.router.demo.DynamicActivity">
tools:context=".DynamicActivity">

<TextView
android:layout_width="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_for_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.chenenyu.router.demo.ForResultActivity">
tools:context=".ForResultActivity">

<TextView
android:id="@+id/text_extra"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context="com.chenenyu.router.demo.MainActivity">
tools:context=".MainActivity">

<EditText
android:id="@+id/edit_route"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.chenenyu.router.demo.TestActivity">
tools:context=".TestActivity">

<TextView
android:id="@+id/text_test"
Expand Down
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-beta1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:2.3.0-beta2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}

allprojects {
repositories {
jcenter()
maven {
url "https://dl.bintray.com/chenenyu/maven"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
minSdkVersion = 14
targetSdkVersion = 25

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

supportVersion = "25.1.0"
}
1 change: 1 addition & 0 deletions buildSrc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
25 changes: 25 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apply plugin: 'groovy'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}

repositories {
jcenter()
}

sourceCompatibility = "1.7"
targetCompatibility = "1.7"

dependencies {
compile gradleApi()
compile localGroovy()
compile 'com.android.tools.build:gradle:2.3.0-beta2'
}

apply from: 'publish.gradle'
58 changes: 58 additions & 0 deletions buildSrc/publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'

Properties config = new Properties()
config.load(project.file('../publish_version.properties').newDataInputStream())
def VERSION = config.getProperty("GRADLE_PLUGIN_VERSION")
def GROUP = 'com.chenenyu.router'
def ARTIFACT_ID = 'gradle-plugin'

group = GROUP
version = VERSION

task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'sources'
}

artifacts {
archives sourcesJar
}

publishing {
publications {
bintray(MavenPublication) {
from components.java
groupId GROUP
artifactId ARTIFACT_ID
version VERSION

artifact sourcesJar
}
}
}

bintray {
Properties properties = new Properties()
boolean hasLocalFile = false
if (project.rootProject.file('local.properties').exists()) {
hasLocalFile = true
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
user = hasLocalFile ? properties.getProperty("bintray.user") : ""
key = hasLocalFile ? properties.getProperty("bintray.apikey") : ""

publications = ['bintray']
pkg {
repo = "maven"
name = "router-gradle-plugin"
websiteUrl = 'https://github.com/chenenyu/Router'
issueTrackerUrl = 'https://github.com/chenenyu/Router/issues'
vcsUrl = 'https://github.com/chenenyu/Router.git'
desc = "Router gradle plugin."
labels = ["Android", "Router", "gradle", "gradle plugin"]
licenses = ["Apache-2.0"]
publicDownloadNumbers = true
publish = true
}
}
Loading

0 comments on commit 9439c63

Please sign in to comment.