Skip to content

Commit

Permalink
Update to 1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CuiVincent committed May 22, 2024
1 parent d9f5c39 commit 065ba8f
Show file tree
Hide file tree
Showing 1,109 changed files with 17,747 additions and 10,374 deletions.
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
Rubik是一套解决Android平台组件化的综合方案,提供gradle project之间的路由通讯能力,以及对gradle project的组件定义、版本控制、maven发布、aar/jar与源码之间的切换以及组件的自由组合等能力。

Rubik由两部分组成:
* Rubik Router :即Rubik的函数级路由能力,与一般的页面路由不同,Rubik Router允许把Uri及参数,导航到工程内部,任意的一个公开的JVM语言(Java/Kotlin)函数的执行上,以便于更灵活的进行gradle project之间不基于代码调用的通讯。
* Rubik Router :提供组件之间的低耦合通讯能力,即Rubik的"函数路由",与一般的页面路由不同,Rubik Router允许把Uri及参数,导航到工程内部,任意的一个公开的JVM语言(Java/Kotlin)函数的执行上,以便于更灵活的进行gradle project之间不基于代码调用的通讯。
* Rubik 工具链 :提供组件上下文的定义、版本控制、maven发布、aar/jar与源码之间的切换等能力,包括4个gradle plugin:
+ rubik:
- 提供全局定义组件的能力,并根据全局定义自动启用rubik-context、rubik-root等插件
- 提供全局定义组件的能力,并根据全局定义自动启用rubik-context、rubik-shell等插件
+ rubik-context:
- 提供task,自动生成镜像函数等中间代码,并把中间代码打包成context.jar ,按版本号发布到maven
- 提供task,自动生成接口中间代码,并把中间代码打包成context.jar ,按版本号发布到maven
- 提供task,把业务代码按flavor、版本号编译成aar (包括代码、资源、内置SDK)发布到maven
- 通过全局定义的组件,为组件所在子工程自动添加其他context.jar的依赖
+ rubik-root
- 给壳工程提供筛选组件等能力,根据flavor、版本号筛选要打包进apk的业务组件
- 通过全局定义的组件,为组件所在子工程自动添加其他组件的context.jar的依赖
+ rubik-shell
- 给壳工程提供筛选组件能力,根据flavor、版本号筛选要打包进apk的业务组件
- 提供组件的源码工程和aar切换的能力
+ rubik-test:
- 给工程提供单元测试环境
Expand All @@ -52,7 +52,7 @@ apply plugin: 'rubik' // 启用rubik插件
rubik {
component { // 第一个组件
uri "app://com.myapp.home" // 组件的Uri
dependencies { // 组件需要依赖的其他组件
touching { // 组件需要依赖的其他组件
uri ("app://com.myapp.detail" ) {
version "0.1.1" // 依赖其他组件的版本
}
Expand Down Expand Up @@ -153,7 +153,3 @@ class RouterTestCase {

## 如何贡献
请用Kotlin语言编写,所有注明动机的合理改动提交都会被接收。


## 讨论
百度如流讨论群:8105247
16 changes: 7 additions & 9 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,23 @@
</div>

<div align="center">
<a href="./README.md">Chinese Readme</a>
<a href="./README.md">中文 Readme</a>
</div>

# Rubik
Rubik is a comprehensive solution for Android platform componentized development. It provides the ability of routing communication between Gradle projects, as well as the ability of component definition, version control, Maven publishing, AAR/JAR and source code switching, and free composition of components.

Rubik consists of two parts:
* Rubik Router :The function level routing capability of Rubik. Unlike normal page router, Rubik Router allows the Uri and parameters to be navigated to any execution of a public JVM language (Java/Kotlin) function . It allows for more flexible communication between Gradle Projects without code calls.
* Rubik Router :Provide low coupling communication between components. The function level routing capability of Rubik. Unlike normal page router, Rubik Router allows the Uri and
parameters to be navigated to any execution of a public JVM language (Java/Kotlin) function . It allows for more flexible communication between Gradle Projects without code calls.
* Rubik Tools link :Provides component context definition, versioning, Maven publishing, AAR/JAR and source switching capabilities, including 4 Gradle Plugins:
+ rubik:
- Provides the ability to define components globally, and automatically enables plugins such as rubik-context and rubik-root based on the global definition
- Provides the ability to define components globally, and automatically enables plugins such as rubik-context and rubik-shell based on the global definition
+ rubik-context:
- Provide Task, automatically generate the intermediate code such as mirror function, and package the intermediate code into context.jar, release to Maven according to the version.
- Provide Task, automatically generate the intermediate code such as interface, and package the intermediate code into context.jar, release to Maven according to the version.
- Provides tasks to compile business codes into AAR (including code, resources, and built-in SDK) based on flavor and version. publish them to Maven.
- Automatically adds dependencies on other context.jars to subprojects where components reside
+ rubik-root
+ rubik-shell
- Provides the ability to picking components, picking components to be packaged into APK based on flavor and version.
- Provide component source code and AAR switching ability.
+ rubik-test:
Expand All @@ -52,7 +53,7 @@ apply plugin: 'rubik' // enable the Rubik plugin
rubik {
component { // The first component
uri "app://com.myapp.home" // The Uri of component
dependencies { // The component needs to depend on other components
touching { // The component needs to depend on other components
uri ("app://com.myapp.detail" ) {
version "0.1.1" // Versions that depend on other components
}
Expand Down Expand Up @@ -154,6 +155,3 @@ class RouterTestCase {
## How to contribute
Please write in Kotlin, and all change commit with reasonable motivation will be accepted.


## Discuss
Baidu 如流 discussion group :8105247
Binary file added Rubik1.10.0使用手册.pdf
Binary file not shown.
Binary file removed Rubik1.9.0_user_manual.pdf
Binary file not shown.
70 changes: 50 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'rubik'
// ./gradlew publishRubikDevHomeRContextLib -Prpubversion=1.0.0

buildscript {
ext {
rubik_tmp_lib_dir = uri('./rubik_libs_repository').path // default:./rubik_libs
// rubik_tmp_lib_dir_mode = false // default: false

rubik_maven_repository = "http://xxxxxx/repository/releases/"
rubik_maven_username = "xxx"
rubik_maven_password = "xxx"
rubik_maven_repository = "http://my.maven/repository/releases/"
rubik_maven_username = "admin" // simple
rubik_maven_password = "123" // simple
rubik_maven_local_repository = uri('./rubik_maven_local_repository').path

// rubik_use_reset_compiler = true // default: false
// rubik_use_reset_compiler = false // default: true

// rubik_publish_context_lib_source = true // default: true

Expand All @@ -27,31 +26,65 @@ buildscript {
rubik_auto_generate_aggregate = true // default: false

rubik_generate_aggregate_in_build_dir = false // default: true
// only usable whenrubik_auto_generate_aggregate = true
// only usable when rubik_auto_generate_aggregate = true

rubik_aggregate_kdoc_add_user_add_time = false // default: true

rubik_auto_generate_component_id = true // default: false

rubik_generate_router_context = true // default: false

// rubik_extension_name = "rk"

// rubik_auto_apply_root_plugin = false // default: true

rubik_auto_apply_test_plugin = true // default: false
// rubik_auto_apply_shell_plugin = false // default: true

rubik_config_file_dirs = [uri('./demo').path]

// modules_snapshot_enable = true // default: false
modules_snapshot_maven_default_group_id = "com.mars.module.demo"
// modules_snapshot_local_mode = false // default: true
// modules_snapshot_local_no_maven_mode = true // default: false

rubik_github_maven_repository = "https://maven.pkg.github.com/baidu/rubik/"
rubik_github_maven_username = "xxx"
rubik_github_maven_password = "xxx"
// rubik_github_maven_repository = "https://maven.pkg.github.com/baidu/rubik/"
// rubik_github_maven_username = "myname"
// rubik_github_maven_password = "123"

// rubik_enable_check_router_version = true // default: false

// rubik_enable_check_context_version = true // default: false

// rubik_check_context_lib_tasks_state = false // default: true

// rubik_context_packing_compile_only = false // default: true

// rubik_auto_fill_flavor = false // default: true

// rubik_strict_touching_and_packing = false // default: true

rubik_except_component_build_types = ['debug']

rubik_except_component_flavors = ['company2']

rubik_remove_project_when_publish_context_libs = false // default: true

rubik_publication_record_files_dir = uri('./rubik_libs_repository').path

// rubik_auto_update_publication_record = false // default: true
//
// rubik_auto_use_publication_record = false // default: true

rubik_publication_record_history_max_size = 15 // default: 10

rubik_on_route_method_max_size = 15 // default: 100

// rubik_sync_code_enable = false // default: true
//
// rubik_auto_generate_settings = false // default: true

rubik_log_level = 1 // 1:all logs , 2:default , 3:least logs

rubik_write_log_to_file = false

// rubik_ignore_value_annotations = ["com.google.gson.annotations.SerializedName"]

}

apply from: 'version-adapter.gradle'
apply from: 'versions.gradle'

addRepos(repositories)
Expand All @@ -61,7 +94,6 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath rubik_plugins_version
classpath deps.ktnail.plugins
}
}

Expand All @@ -72,5 +104,3 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}

apply from: 'version-tasks.gradle'
30 changes: 14 additions & 16 deletions demo/demo_component_detail/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
compileSdkVersion 30
buildToolsVersion "30.0.0"

defaultConfig {
minSdkVersion 15
targetSdkVersion 29
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"

Expand All @@ -27,15 +27,14 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

// flavorDimensions "company", "channel"
//
// productFlavors {
// company1 { dimension "company" }
// company2 { dimension "company" }
// channel1 { dimension "channel" }
// channel2 { dimension "channel" }
// channel3 { dimension "channel" }
// }
flavorDimensions "company", "channel"

productFlavors {
company1 { dimension "company" }
company2 { dimension "company" }
channel1 { dimension "channel" }
channel2 { dimension "channel" }
}

}

Expand All @@ -49,12 +48,11 @@ rubik {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.code.gson:gson:2.8.5'

implementation project(':demo:demo_until_library_a')

// implementation project(':demo:demo_until_library_a')
}

This file was deleted.

Loading

0 comments on commit 065ba8f

Please sign in to comment.