-
Notifications
You must be signed in to change notification settings - Fork 434
Sample for building multi platform projects #800
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Valeriy Zhirnov <[email protected]>
|
||
dependencies { | ||
classpath(kotlin("gradle-plugin", "1.2.31")) | ||
classpath(kotlin("native-gradle-plugin", "0.6.2")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the plugins{}
block for these dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how to move these into plugins block, it just breaks the build for me
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why using base? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it "archives" task do not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
} | ||
|
||
allprojects { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is all that "boilerplate" really needed?
I think it would be good to define everything in their build.gradle files. Instead of the project build.gradle file..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better apply it once for all project
|
||
repositories { | ||
mavenCentral() | ||
jcenter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't mirror jcenter mavencentral?
So jcenter() is enough, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is
|
||
tasks.withType<Wrapper> { | ||
distributionType = Wrapper.DistributionType.ALL | ||
gradleVersion = "4.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the latest version: 4.7
(and update the wrapper, of course)
|
||
dependencies { | ||
"expectedBy"(project(":platform-common")) | ||
"implementation"(kotlin("stdlib-js")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why using "xx"
instead of dirctly the method implementation(kotlin(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intellij breaks time to time when it's defined without quotes
also for some reaseon in native project it does not understand expectedBy without quotes
} | ||
|
||
dependencies { | ||
"expectedBy"(project(":platform-common")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -0,0 +1,18 @@ | |||
import org.gradle.internal.impldep.bsh.commands.dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that needed?
@@ -0,0 +1,31 @@ | |||
import org.jetbrains.kotlin.gradle.plugin.KonanArtifactContainer | |||
|
|||
apply { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use one code style. With the plugins {}
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how to move this intro plugins block
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
google() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need google()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just leftover from tying to add android as a platform
@StefMa updated pr, please look at it when you have time |
Signed-off-by: Neonailol <[email protected]>
Signed-off-by: Neonailol <[email protected]>
Context
This is a full sample of building the multiplatform kotlin project (common, js, jvm. native)
Contributor Checklist
develop
branch./gradlew check --parallel