Skip to content

Commit

Permalink
1.API 'variant.getJavaCompile()' is obsolete #
Browse files Browse the repository at this point in the history
  • Loading branch information
Fimics committed Dec 26, 2019
1 parent 45a6c2f commit 823ff65
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 34 deletions.
7 changes: 7 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,11 @@ dependencies {
apply from :rootProject.file('build_depends.gradle')
api project(':app-core')

if (gradle.hasProperty('exoplayerRoot')) {
implementation project(':exoplayer-library-core')
implementation project(':exoplayer-library-dash')
implementation project(':exoplayer-library-hls')
implementation project(':exoplayer-extension-ima')
}

}
3 changes: 3 additions & 0 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,8 @@ ext {

//EventBus
'eventbus' : 'org.greenrobot:eventbus:3.0.0',

//fabric
fabric : 'io.fabric.tools:gradle:1.30.0',
]
}
56 changes: 23 additions & 33 deletions demo-sample/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
cmake_minimum_required(VERSION 3.6)
project(demo)
## brew install ninja najagithub gteest-demo , GUnit
#https://source.android.com/compatibility/tests/development
#add_library( # Specifies the name of the library.
# # 这里是你so的名字。刚才在 MainActivity里面要引用的
# structure
#
# # Sets the library as a shared library.
# SHARED
#
# # Provides a relative path to your source file(s).
# #这里是刚才 创建的c++ 代码的名字
# src/main/cpp/Structure.cpp
# )
#
#find_library( # Sets the name of the path variable.
# log-lib
#
# # Specifies the name of the NDK library that
# # you want CMake to locate.
# log)
#
#target_link_libraries( # Specifies the target library.
# # 这里是你so的名字。刚才在 MainActivity里面要引用的 一样。
# structure
#
# # Links the target library to the log library
# # included in the NDK.
# ${log-lib})
add_library( # Specifies the name of the library.
# 这里是你so的名字。刚才在 MainActivity里面要引用的
structure

# Sets the library as a shared library.
SHARED

set(GOOGLETEST_ROOT ${ANDROID_NDK}/sources/third_party/googletest)
add_library(gtest STATIC ${GOOGLETEST_ROOT}/src/gtest_main.cc ${GOOGLETEST_ROOT}/src/gtest-all.cc)
target_include_directories(gtest PRIVATE ${GOOGLETEST_ROOT})
target_include_directories(gtest PUBLIC ${GOOGLETEST_ROOT}/include)
# Provides a relative path to your source file(s).
#这里是刚才 创建的c++ 代码的名字
src/main/cpp/Structure.cpp
)

add_executable(footest ./tests/HelloWorldTest.cpp)
target_link_libraries(footest gtest)
find_library( # Sets the name of the path variable.
log-lib

# Specifies the name of the NDK library that
# you want CMake to locate.
log)

target_link_libraries( # Specifies the target library.
# 这里是你so的名字。刚才在 MainActivity里面要引用的 一样。
structure

# Links the target library to the log library
# included in the NDK.
${log-lib})
8 changes: 7 additions & 1 deletion demo-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ variants.all { variant ->
return
}

JavaCompile javaCompile = variant.javaCompile
JavaCompile javaCompile
if (variant.hasProperty('javaCompileProvider')) {
// Android 3.3.0+
javaCompile = variant.javaCompileProvider.get()
} else {
javaCompile = variant.javaCompile
}
javaCompile.doLast {
String[] args = ["-showWeaveInfo",
"-1.8",
Expand Down
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
def debug = false;


if(debug){
gradle.ext.exoplayerRoot = 'path/to/ExoPlayer'
gradle.ext.exoplayerModulePrefix = 'exoplayer-'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')
}


include ':app',
':app-core',
':demo-sample',
Expand Down

0 comments on commit 823ff65

Please sign in to comment.