Skip to content

Commit

Permalink
不再为每个micromodule生成各自的R类
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchengdong committed Jul 2, 2019
1 parent dbecfad commit 99ef8bc
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 694 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.application.base;

import com.eastwood.demo.application.R;

/**
* @author eastwood
* createDate: 2018-05-29
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.application.common;

import com.eastwood.demo.application.R;

/**
* @author eastwood
* createDate: 2018-11-26
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.application.home;

import com.eastwood.demo.application.R;

/**
* @author eastwood
* createDate: 2018-11-26
Expand Down
8 changes: 7 additions & 1 deletion kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'micro-module'
apply plugin: 'com.android.library'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
Expand All @@ -23,8 +22,15 @@ android {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

preview {

}
}

androidExtensions {
experimental = true
}
}

microModule {
Expand Down
13 changes: 0 additions & 13 deletions kotlin/main/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
// MicroModule build file where you can add configuration options to publish MicroModule(aar) to Maven
// and declare MicroModule dependencies.

microModule {
mavenArtifact {
groupId 'com.eastwood.demo'
artifactId 'kotlin-main'
version '1.0.0-SNAPSHOT'

repository {
url "***"
authentication(userName: '***', password: '***')
}
}
}

dependencies {
implementation fileTree(dir: 'main/libs', include: ['*.jar'])
// implementation microModule(':p_common')
Expand Down
2 changes: 1 addition & 1 deletion kotlin/main/src/main/java/com/eastwood/demo/kotlin/Test.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Test {

fun test() {
// can't use [R.string.kotlin_common] which from microModule ':p_common'.
var i = R.string.kotlin_common
// var i = R.string.kotlin_common
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Test1 {

fun test() {
// can't use [R.string.kotlin_common] which from microModule ':p_common'.
var i = R.string.kotlin_common
// var i = R.string.kotlin_common
}

}
16 changes: 0 additions & 16 deletions kotlin/p_common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
// MicroModule build file where you can add configuration options to publish MicroModule(aar) to Maven
// and declare MicroModule dependencies.

microModule {

useMavenArtifact false

mavenArtifact {
groupId 'com.eastwood.demo'
artifactId 'kotlin-p_common'
version '1.0.0-SNAPSHOT'

repository {
url "***"
authentication(userName: '***', password: '***')
}
}
}

dependencies {
implementation fileTree(dir: 'p_common/libs', include: ['*.jar'])
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.kotlin.common

import com.eastwood.demo.kotlin.R

/**
*
* @author eastwood
Expand All @@ -8,6 +10,7 @@ package com.eastwood.demo.kotlin.common
class Common {

fun test() {

var i = R.string.kotlin_common
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.kotlin.common

import com.eastwood.demo.kotlin.R

/**
*
* @author eastwood
Expand Down
16 changes: 0 additions & 16 deletions library/main/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
microModule {

useMavenArtifact false

mavenArtifact {
groupId 'com.eastwood.demo'
artifactId 'library-main'
version '1.0.0-SNAPSHOT'

repository {
url "***"
authentication(userName: '***', password: '***')
}
}

}

dependencies {
implementation microModule(':p_common')
Expand Down
15 changes: 0 additions & 15 deletions library/p_base/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
microModule {

useMavenArtifact false

mavenArtifact {
groupId 'com.eastwood.demo'
artifactId 'library-p_base'
version '1.0.0-SNAPSHOT'

repository {
url "***"
authentication(userName: '***', password: '***')
}
}
}

dependencies {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.library.base;

import com.eastwood.demo.library.R;

/**
* @author eastwood
* createDate: 2018-11-09
Expand Down
15 changes: 0 additions & 15 deletions library/p_common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
microModule {

useMavenArtifact false

mavenArtifact {
groupId 'com.eastwood.demo'
artifactId 'library-p_common'
version '1.0.0-SNAPSHOT'

repository {
url "***"
authentication(userName: '***', password: '***')
}
}
}

dependencies {
implementation microModule(':p_base')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.library.common;

import com.eastwood.demo.library.R;

/**
* @author eastwood
* createDate: 2018-11-09
Expand Down
15 changes: 0 additions & 15 deletions library/p_utils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
microModule {

useMavenArtifact false

mavenArtifact {
groupId 'com.eastwood.demo'
artifactId 'library-p_util'
version '1.0.0-SNAPSHOT'

repository {
url "***"
authentication(userName: '***', password: '***')
}
}
}

dependencies {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.eastwood.demo.library.utils;

import com.eastwood.demo.library.R;

/**
* @author eastwood
* createDate: 2018-05-29
Expand Down
Loading

0 comments on commit 99ef8bc

Please sign in to comment.