Skip to content

Commit

Permalink
增加没有 cmake 也能编译支持
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Jun 24, 2020
1 parent 2e108df commit 32a7d0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ android {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
buildConfigField "String", "CLIENT_ID", properties.getProperty("CLIENT_ID")
buildConfigField "String", "CLIENT_SECRET", properties.getProperty("CLIENT_SECRET")
buildConfigField "boolean", "NEED_CMAKE_TEST", "$needCMakeTest"

if (needCMakeTest) {
//CMake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import com.mikepenz.iconics.context.IconicsLayoutInflater2
import com.shuyu.github.kotlin.BuildConfig
import com.shuyu.github.kotlin.R
import com.shuyu.github.kotlin.common.utils.Debuger
import com.shuyu.github.kotlin.model.AppGlobalModel
Expand All @@ -32,7 +33,9 @@ class MainActivity : AppCompatActivity(), HasSupportFragmentInjector, Toolbar.On

companion object {
init {
System.loadLibrary("native-gsy")
if(BuildConfig.NEED_CMAKE_TEST) {
System.loadLibrary("native-gsy")
}
}
}

Expand Down Expand Up @@ -80,8 +83,9 @@ class MainActivity : AppCompatActivity(), HasSupportFragmentInjector, Toolbar.On

MainDrawerController(this, home_tool_bar, loginRepository, issueRepository, repositoryRepository, globalModel)


Debuger.printfWarning(stringFromJNI())
if(BuildConfig.NEED_CMAKE_TEST) {
Debuger.printfWarning(stringFromJNI())
}

}

Expand Down

0 comments on commit 32a7d0a

Please sign in to comment.