Commit 29831a89 by 徐健
parents c9e642e5 2786cc3c
...@@ -11,6 +11,8 @@ import com.ydl.ydlcommon.utils.YdlBuryPointUtil; ...@@ -11,6 +11,8 @@ import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import io.flutter.view.FlutterMain;
/** /**
* Created by haorui on 2019-09-02. * Created by haorui on 2019-09-02.
* Des: * Des:
...@@ -25,6 +27,10 @@ public class DemoAppLifecycles implements IAppLifecycles { ...@@ -25,6 +27,10 @@ public class DemoAppLifecycles implements IAppLifecycles {
public void onCreate(@NotNull Application application) { public void onCreate(@NotNull Application application) {
//数据埋点初始化--一定要放在主进程中 //数据埋点初始化--一定要放在主进程中
YdlBuryPointUtil.init(application); YdlBuryPointUtil.init(application);
//Flutter 初始化需要在主线程中执行
FlutterMain.startInitialization(application);
Intent intent = new Intent(application, PlayService.class); Intent intent = new Intent(application, PlayService.class);
application.startService(intent); application.startService(intent);
} }
......
...@@ -171,21 +171,26 @@ ext { ...@@ -171,21 +171,26 @@ ext {
"ydl-net" : 'com.ydl:ydl-net:0.0.1', "ydl-net" : 'com.ydl:ydl-net:0.0.1',
"ydl-user-router" : 'com.ydl:router:1.0.0-SNAPSHOT@aar', "ydl-user-router" : 'com.ydl:router:1.0.0-SNAPSHOT@aar',
"ydl-device" : 'com.ydl:device-id:0.0.7@aar', "ydl-device" : 'com.ydl:device-id:0.0.7@aar',
"ydl-flutter" : 'com.ydl:ydl-flutter:0.0.2@aar',
//flutter功能组件升级===>发布ydl-flutter-base组件===>引用flutter相关的业务模块
"ydl-flutter" : 'com.ydl:ydl-flutter:0.0.6@aar',
"ydl-flutter-base" : 'com.ydl:ydl-flutter-base:0.0.2@aar',
//基础组件 <<--- 先发这个,发完改这里的版本号 //基础组件 <<--- 先发这个,发完改这里的版本号
"ydl-platform" : 'com.ydl:ydl-platform:0.0.16@aar', "ydl-platform" : 'com.ydl:ydl-platform:0.0.18@aar',
//功能组件 <<--- 再发这些,发完改这里的版本号 //功能组件 <<--- 再发这些,发完改这里的版本号
"ydl-webview" : 'com.ydl:ydl-webview:0.0.16@aar', "ydl-webview" : 'com.ydl:ydl-webview:0.0.18@aar',
"ydl-media" : 'com.ydl:ydl-media:0.0.5@aar', "ydl-media" : 'com.ydl:ydl-media:0.0.7@aar',
"ydl-audioim" : 'com.ydl:m-audioim:0.0.4@aar', "ydl-audioim" : 'com.ydl:m-audioim:0.0.6@aar',
"ydl-pay" : 'com.ydl:ydl-pay:0.0.2@aar',
//业务组件 <<--- 最后发这些(只发改过的) //业务组件 <<--- 最后发这些(只发改过的)
"ydl-m-user-api" : 'com.ydl:m-user-api:0.0.5', "ydl-m-user-api" : 'com.ydl:m-user-api:0.0.5',
"ydl-m-muse-api" : 'com.ydl:m-muse-api:0.0.1', "ydl-m-muse-api" : 'com.ydl:m-muse-api:0.0.1',
"ydl-m-fm-api" : 'com.ydl:m-fm-api:0.0.2', "ydl-m-fm-api" : 'com.ydl:m-fm-api:0.0.2',
"ydl-m-fm-module-ydl" : 'com.ydl:m-fm-module-ydl:0.0.6@aar', "ydl-m-fm-module-ydl" : 'com.ydl:m-fm-module-ydl:0.0.6@aar',
"ydl-m-course-module-ydl" : 'com.ydl:m-course-module-ydl:0.0.1@aar',
"ydl-m-tests-api" : 'com.ydl:m-tests-api:0.0.1', "ydl-m-tests-api" : 'com.ydl:m-tests-api:0.0.1',
] ]
......
IS_PUBLISH=true IS_PUBLISH=true
VERSION_NAME=0.0.4 VERSION_NAME=0.0.6
\ No newline at end of file \ No newline at end of file
...@@ -46,6 +46,9 @@ android { ...@@ -46,6 +46,9 @@ android {
sourceSets { sourceSets {
main { main {
manifest.srcFile 'src/main/AndroidManifest.xml' manifest.srcFile 'src/main/AndroidManifest.xml'
res.srcDirs = [
'src/main/res'
]
} }
} }
...@@ -76,10 +79,18 @@ dependencies { ...@@ -76,10 +79,18 @@ dependencies {
api project(":ydl-platform") api project(":ydl-platform")
api project(":ydl-media") api project(":ydl-media")
api project(":ydl-pay") api project(":ydl-pay")
api project(":ydl-flutter-base")
} else { } else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
}
api rootProject.ext.dependencies["ydl-pay"]
api (rootProject.ext.dependencies["ydl-flutter-base"]){
transitive = true
}
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
} }
......
isApplicaiton = false
modular { modular {
//模块包名 //模块包名
packageName "com.yidianling.course" packageName "com.ydl.course"
// 模块发布需要的参数 // 模块发布需要的参数
publish { publish {
modules { modules {
...@@ -8,14 +8,14 @@ modular { ...@@ -8,14 +8,14 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-course-module-xlzx" artifactId = "m-course-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号 // 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.11" version = "0.0.1"
} }
ydl{ ydl{
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-course-module-ydl" artifactId = "m-course-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号 // 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.11" version = "0.0.1"
} }
} }
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-course-api" artifactId = "m-course-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
//version = "0.0.1" version = "0.0.1"
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -6,8 +6,8 @@ import android.os.Handler ...@@ -6,8 +6,8 @@ import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.ydl_flutter.flutter.base.BaseFlutterFragment
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterFragment
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
......
...@@ -9,9 +9,9 @@ import com.ydl.media.view.PlayerFloatHelper ...@@ -9,9 +9,9 @@ import com.ydl.media.view.PlayerFloatHelper
import com.ydl.media.view.PlayerFloatView import com.ydl.media.view.PlayerFloatView
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydl_flutter.flutter.base.BaseFlutterFragment
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterFragment
import com.ydl.ydlcommon.data.PlatformDataManager import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
......
package com.yidianling.course.flutterPlugin package com.yidianling.course.flutterPlugin
import com.ydl.ydlcommon.base.flutter.io.flutter.facade.FlutterFragment import com.ydl.ydl_flutter.flutter.io.flutter.facade.FlutterFragment
import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.EventChannel
import io.flutter.view.FlutterView import io.flutter.view.FlutterView
......
...@@ -66,9 +66,13 @@ dependencies { ...@@ -66,9 +66,13 @@ dependencies {
//开发时使用 //开发时使用
api project(":ydl-platform") api project(":ydl-platform")
implementation project(':ydl-media') implementation project(':ydl-media')
api project(":ydl-flutter-base")
} else { } else {
//发布时使用 //发布时使用
api rootProject.ext.dependencies["ydl-media"] api rootProject.ext.dependencies["ydl-media"]
api (rootProject.ext.dependencies["ydl-flutter-base"]){
transitive = true
}
api (rootProject.ext.dependencies["ydl-platform"]) { api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
} }
......
...@@ -2,7 +2,7 @@ package com.yidianling.muse.activity ...@@ -2,7 +2,7 @@ package com.yidianling.muse.activity
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.media.audio.AudioPlayer import com.ydl.media.audio.AudioPlayer
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterActivity import com.ydl.ydl_flutter.flutter.base.BaseFlutterActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.muse.handler.MusePlugin import com.yidianling.muse.handler.MusePlugin
import org.json.JSONObject import org.json.JSONObject
......
include ':app',":router", ':ydl-net', ':ydl-utils', ':ydl-platform', ':ydl-webview', include ':app', ':ydl-flutter-base',":router", ':ydl-net', ':ydl-utils', ':ydl-platform', ':ydl-webview',
':m-confide', ':m-audioim',':ydl-media',":m-user", ':m-consultant', ':m-muse', ':m-confide', ':m-audioim',':ydl-media',":m-user", ':m-consultant', ':m-muse',
':m-fm', ':m-tests',":m-course", ':ydl-pay' ':m-fm', ':m-tests',":m-course", ':ydl-pay'
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
flavorDimensions "versionCode"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
api rootProject.ext.dependencies["ydl-flutter"]
}
IS_PUBLISH=true
VERSION_NAME=0.0.2
\ No newline at end of file
# 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
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ydl.ydl_flutter" />
package com.ydl.ydlcommon.base.flutter.base package com.ydl.ydl_flutter.flutter.base
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
......
package com.ydl.ydlcommon.base.flutter.base package com.ydl.ydl_flutter.flutter.base
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.ViewGroup import android.view.ViewGroup
import com.ydl.ydlcommon.base.flutter.io.flutter.facade.Flutter import com.ydl.ydl_flutter.flutter.io.flutter.facade.Flutter
import com.ydl.ydlcommon.base.flutter.io.flutter.facade.FlutterFragment import com.ydl.ydl_flutter.flutter.io.flutter.facade.FlutterFragment
import io.flutter.view.FlutterView import io.flutter.view.FlutterView
/** /**
...@@ -16,7 +16,7 @@ abstract class BaseFlutterFragment : FlutterFragment() { ...@@ -16,7 +16,7 @@ abstract class BaseFlutterFragment : FlutterFragment() {
private var mFlutterView: FlutterView? = null private var mFlutterView: FlutterView? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): FlutterView { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): FlutterView {
mFlutterView=Flutter.createView( mFlutterView= Flutter.createView(
activity!!, activity!!,
lifecycle, lifecycle,
initialRoute()) initialRoute())
......
package com.ydl.ydlcommon.base.flutter.io.flutter.facade; package com.ydl.ydl_flutter.flutter.io.flutter.facade;
import android.app.Activity; import android.app.Activity;
import android.arch.lifecycle.Lifecycle; import android.arch.lifecycle.Lifecycle;
......
package com.ydl.ydlcommon.base.flutter.io.flutter.facade; package com.ydl.ydl_flutter.flutter.io.flutter.facade;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
......
<resources>
<string name="app_name">ydl_flutter</string>
</resources>
IS_PUBLISH=true IS_PUBLISH=true
VERSION_NAME=0.0.5 VERSION_NAME=0.0.7
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply from: "../maven_push.gradle"
android { android {
compileSdkVersion 28 compileSdkVersion 28
...@@ -56,7 +57,6 @@ dependencies { ...@@ -56,7 +57,6 @@ dependencies {
api 'com.umeng.sdk:share-wechat:6.9.1' api 'com.umeng.sdk:share-wechat:6.9.1'
api rootProject.ext.dependencies["ydl-hnet"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
......
IS_PUBLISH=true
VERSION_NAME=0.0.2
\ No newline at end of file
...@@ -78,7 +78,6 @@ dependencies { ...@@ -78,7 +78,6 @@ dependencies {
api rootProject.ext.dependencies["imagepicker"] api rootProject.ext.dependencies["imagepicker"]
api rootProject.ext.dependencies["ydl-utils"] api rootProject.ext.dependencies["ydl-utils"]
api rootProject.ext.dependencies["ydl-js"] api rootProject.ext.dependencies["ydl-js"]
api rootProject.ext.dependencies["ydl-flutter"]
api rootProject.ext.dependencies["ydl-net"] api rootProject.ext.dependencies["ydl-net"]
api rootProject.ext.dependencies["ydl-js"] api rootProject.ext.dependencies["ydl-js"]
api(rootProject.ext.dependencies["ydl-device"]) { api(rootProject.ext.dependencies["ydl-device"]) {
......
IS_PUBLISH=true IS_PUBLISH=true
VERSION_NAME=0.0.16 VERSION_NAME=0.0.18
\ No newline at end of file \ No newline at end of file
package com.ydl.ydlcommon.base package com.ydl.ydlcommon.base
import android.app.Application import android.app.Application
import android.content.Context import android.content.Context
import android.support.multidex.MultiDex import android.support.multidex.MultiDex
import com.ydl.ydlcommon.base.config.GlobalConfig import com.ydl.ydlcommon.base.config.GlobalConfig
import com.ydl.ydlcommon.base.config.IApp import com.ydl.ydlcommon.base.config.IApp
import com.ydl.ydlcommon.base.delegate.AppDelegate import com.ydl.ydlcommon.base.delegate.AppDelegate
import com.ydl.ydlcommon.base.delegate.IAppLifecycles import com.ydl.ydlcommon.base.delegate.IAppLifecycles
import com.ydl.ydlcommon.utils.YDLPreconditions import com.ydl.ydlcommon.utils.YDLPreconditions
import io.flutter.view.FlutterMain
/**
/** * Created by haorui on 2019-08-21 .
* Created by haorui on 2019-08-21 . * Des: 基础Application
* Des: 基础Application */
*/ open class BaseApp : Application(), IApp {
open class BaseApp : Application(), IApp {
private var mAppDelegate: IAppLifecycles? = null
private var mAppDelegate: IAppLifecycles? = null
companion object {
companion object {
lateinit var instance: BaseApp
lateinit var instance: BaseApp
fun getApp(): Application {
fun getApp(): Application { return instance
return instance }
} }
}
/**
/** * 这里会在 [BaseApp.onCreate] 之前被调用,可以做一些较早的初始化
* 这里会在 [BaseApp.onCreate] 之前被调用,可以做一些较早的初始化 * 常用于 MultiDex 以及插件化框架的初始化
* 常用于 MultiDex 以及插件化框架的初始化 *
* * @param base
* @param base */
*/ override fun attachBaseContext(base: Context) {
override fun attachBaseContext(base: Context) { super.attachBaseContext(base)
super.attachBaseContext(base) instance = this;
instance = this; MultiDex.install(this)
MultiDex.install(this) if (mAppDelegate == null)
if (mAppDelegate == null) this.mAppDelegate = AppDelegate(base)
this.mAppDelegate = AppDelegate(base) this.mAppDelegate!!.attachBaseContext(base)
this.mAppDelegate!!.attachBaseContext(base) }
}
override fun onCreate() {
override fun onCreate() { super.onCreate()
super.onCreate() if (mAppDelegate != null)
if (mAppDelegate != null) this.mAppDelegate!!.onCreate(this)
this.mAppDelegate!!.onCreate(this)
}
//Flutter 初始化需要在主线程中执行 /**
FlutterMain.startInitialization(this) * 在模拟环境中程序终止时会被调用
} */
override fun onTerminate() {
/** super.onTerminate()
* 在模拟环境中程序终止时会被调用 if (mAppDelegate != null)
*/ this.mAppDelegate!!.onTerminate(this)
override fun onTerminate() { }
super.onTerminate()
if (mAppDelegate != null) override fun getGlobalConfig(): GlobalConfig {
this.mAppDelegate!!.onTerminate(this) YDLPreconditions.checkNotNull(
} mAppDelegate,
"%s cannot be null",
override fun getGlobalConfig(): GlobalConfig { AppDelegate::class.java.name
YDLPreconditions.checkNotNull(mAppDelegate, "%s cannot be null", AppDelegate::class.java.name) )
YDLPreconditions.checkState( YDLPreconditions.checkState(
mAppDelegate is IApp, mAppDelegate is IApp,
"%s must be implements %s", "%s must be implements %s",
mAppDelegate!!::class.java.name, mAppDelegate!!::class.java.name,
IApp::class.java.name IApp::class.java.name
) )
return (mAppDelegate as IApp).getGlobalConfig() return (mAppDelegate as IApp).getGlobalConfig()
} }
} }
IS_PUBLISH=true IS_PUBLISH=true
VERSION_NAME=0.0.16 VERSION_NAME=0.0.18
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment