Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
ddeb174a
Commit
ddeb174a
authored
Jan 05, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore Android targets when Android SDK is not installed
parent
10d813ce
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
40 deletions
+89
-40
mirai-core-qqandroid/build.gradle.kts
mirai-core-qqandroid/build.gradle.kts
+26
-12
mirai-core-timpc/build.gradle.kts
mirai-core-timpc/build.gradle.kts
+26
-13
mirai-core/build.gradle.kts
mirai-core/build.gradle.kts
+27
-13
settings.gradle
settings.gradle
+10
-2
No files found.
mirai-core-qqandroid/build.gradle.kts
View file @
ddeb174a
@
file
:
Suppress
(
"UNUSED_VARIABLE"
)
@
file
:
Suppress
(
"UNUSED_VARIABLE"
)
import
java.util.Properties
plugins
{
plugins
{
kotlin
(
"multiplatform"
)
kotlin
(
"multiplatform"
)
...
@@ -31,6 +32,11 @@ description = "QQ protocol library"
...
@@ -31,6 +32,11 @@ description = "QQ protocol library"
version
=
rootProject
.
ext
.
get
(
"mirai_version"
)
!!
.
toString
()
version
=
rootProject
.
ext
.
get
(
"mirai_version"
)
!!
.
toString
()
kotlin
{
kotlin
{
val
keyProps
=
Properties
()
val
keyFile
=
file
(
"../local.properties"
)
if
(
keyFile
.
exists
())
keyProps
.
load
(
keyFile
.
inputStream
())
if
(
keyProps
.
getProperty
(
"sdk.dir"
,
""
).
isNotEmpty
())
{
android
(
"android"
)
{
android
(
"android"
)
{
publishAllLibraryVariants
()
publishAllLibraryVariants
()
project
.
android
{
project
.
android
{
...
@@ -47,6 +53,14 @@ kotlin {
...
@@ -47,6 +53,14 @@ kotlin {
//(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
//(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
}
}
}
}
}
else
{
println
(
"""Android SDK 可能未安装.
$name 的 Android 目标编译将不会进行.
这不会影响 Android 以外的平台的编译, 因此 JVM 等平台相关的编译和测试均能正常进行.
"""
.
trimIndent
()
)
}
jvm
(
"jvm"
)
{
jvm
(
"jvm"
)
{
}
}
...
...
mirai-core-timpc/build.gradle.kts
View file @
ddeb174a
@
file
:
Suppress
(
"UNUSED_VARIABLE"
)
@
file
:
Suppress
(
"UNUSED_VARIABLE"
)
import
java.util.Properties
plugins
{
plugins
{
kotlin
(
"multiplatform"
)
kotlin
(
"multiplatform"
)
...
@@ -31,6 +32,10 @@ description = "QQ protocol library"
...
@@ -31,6 +32,10 @@ description = "QQ protocol library"
version
=
rootProject
.
ext
.
get
(
"mirai_version"
)
!!
.
toString
()
version
=
rootProject
.
ext
.
get
(
"mirai_version"
)
!!
.
toString
()
kotlin
{
kotlin
{
val
keyProps
=
Properties
()
val
keyFile
=
file
(
"../local.properties"
)
if
(
keyFile
.
exists
())
keyProps
.
load
(
keyFile
.
inputStream
())
if
(
keyProps
.
getProperty
(
"sdk.dir"
,
""
).
isNotEmpty
())
{
android
(
"android"
)
{
android
(
"android"
)
{
publishAllLibraryVariants
()
publishAllLibraryVariants
()
project
.
android
{
project
.
android
{
...
@@ -47,6 +52,14 @@ kotlin {
...
@@ -47,6 +52,14 @@ kotlin {
//(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
//(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
}
}
}
}
}
else
{
println
(
"""Android SDK 可能未安装.
$name 的 Android 目标编译将不会进行.
这不会影响 Android 以外的平台的编译, 因此 JVM 等平台相关的编译和测试均能正常进行.
"""
.
trimIndent
()
)
}
jvm
(
"jvm"
)
{
jvm
(
"jvm"
)
{
}
}
...
...
mirai-core/build.gradle.kts
View file @
ddeb174a
@
file
:
Suppress
(
"UNUSED_VARIABLE"
)
@
file
:
Suppress
(
"UNUSED_VARIABLE"
)
import
java.util.*
plugins
{
plugins
{
kotlin
(
"multiplatform"
)
kotlin
(
"multiplatform"
)
id
(
"kotlinx-atomicfu"
)
id
(
"kotlinx-atomicfu"
)
...
@@ -30,6 +32,10 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
...
@@ -30,6 +32,10 @@ fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
description
=
"QQ protocol library"
description
=
"QQ protocol library"
kotlin
{
kotlin
{
val
keyProps
=
Properties
()
val
keyFile
=
file
(
"../local.properties"
)
if
(
keyFile
.
exists
())
keyProps
.
load
(
keyFile
.
inputStream
())
if
(
keyProps
.
getProperty
(
"sdk.dir"
,
""
).
isNotEmpty
())
{
android
(
"android"
)
{
android
(
"android"
)
{
publishAllLibraryVariants
()
publishAllLibraryVariants
()
project
.
android
{
project
.
android
{
...
@@ -46,6 +52,14 @@ kotlin {
...
@@ -46,6 +52,14 @@ kotlin {
//(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
//(sourceSets["main"] as AndroidSourceSet).java.srcDirs(file("src/androidMain/kotlin"))
}
}
}
}
}
else
{
println
(
"""Android SDK 可能未安装.
$name 的 Android 目标编译将不会进行.
这不会影响 Android 以外的平台的编译, 因此 JVM 等平台相关的编译和测试均能正常进行.
"""
.
trimIndent
()
)
}
jvm
(
"jvm"
)
{
jvm
(
"jvm"
)
{
}
}
...
...
settings.gradle
View file @
ddeb174a
...
@@ -31,7 +31,16 @@ include(':mirai-api-http')
...
@@ -31,7 +31,16 @@ include(':mirai-api-http')
include
(
':mirai-demos:mirai-demo-1'
)
include
(
':mirai-demos:mirai-demo-1'
)
include
(
':mirai-demos:mirai-demo-gentleman'
)
include
(
':mirai-demos:mirai-demo-gentleman'
)
include
(
':mirai-demos'
)
include
(
':mirai-demos'
)
include
(
':mirai-demos:mirai-demo-android'
)
def
keyProps
=
new
Properties
()
def
keyFile
=
file
(
"local.properties"
)
if
(
keyFile
.
exists
())
keyFile
.
withInputStream
{
keyProps
.
load
(
it
)
}
if
(!
keyProps
.
getProperty
(
"sdk.dir"
,
""
).
isEmpty
())
{
include
(
':mirai-demos:mirai-demo-android'
)
project
(
':mirai-demos:mirai-demo-android'
).
projectDir
=
file
(
'mirai-demos/mirai-demo-android'
)
}
else
{
println
(
"Android SDK 可能未安装. \n将不会加载模块 `mirai-demo-android`, 但这并不影响其他 demo 的加载 "
)
}
def
javaVersion
=
System
.
getProperty
(
"java.version"
)
def
javaVersion
=
System
.
getProperty
(
"java.version"
)
if
(
javaVersion
.
substring
(
0
,
javaVersion
.
indexOf
(
"."
)).
toInteger
()
>=
11
)
{
if
(
javaVersion
.
substring
(
0
,
javaVersion
.
indexOf
(
"."
)).
toInteger
()
>=
11
)
{
...
@@ -42,6 +51,5 @@ if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
...
@@ -42,6 +51,5 @@ if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
project
(
':mirai-demos:mirai-demo-1'
).
projectDir
=
file
(
'mirai-demos/mirai-demo-1'
)
project
(
':mirai-demos:mirai-demo-1'
).
projectDir
=
file
(
'mirai-demos/mirai-demo-1'
)
project
(
':mirai-demos:mirai-demo-gentleman'
).
projectDir
=
file
(
'mirai-demos/mirai-demo-gentleman'
)
project
(
':mirai-demos:mirai-demo-gentleman'
).
projectDir
=
file
(
'mirai-demos/mirai-demo-gentleman'
)
project
(
':mirai-demos:mirai-demo-android'
).
projectDir
=
file
(
'mirai-demos/mirai-demo-android'
)
enableFeaturePreview
(
'GRADLE_METADATA'
)
enableFeaturePreview
(
'GRADLE_METADATA'
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment