@@ -29,13 +29,30 @@ import utils.shouldTreatCompilerWarningsAsErrors
2929/* *
3030 * An extension to create main Kotlin source set.
3131 *
32- * @param namedDomainObjectContainer The container to create the corresponding source set
32+ * @param sourceSet The container to create the corresponding source set
3333 *
3434 * @return The main Kotlin [SourceSet]
3535 */
36- fun Project.createKotlinMainSources (
37- namedDomainObjectContainer : NamedDomainObjectContainer <SourceSet >
38- ) = MainSources .create(namedDomainObjectContainer, this )
36+ fun Project.createKotlinMainSources (sourceSet : NamedDomainObjectContainer <SourceSet >) =
37+ MainSources .create(sourceSet, this )
38+
39+ fun Project.isJavaProject () =
40+ listOf (" java-library" , " java" , " java-gradle-plugin" ).any { plugins.hasPlugin(it) }
41+
42+ fun Project.isKotlinProject () =
43+ listOf (" kotlin" , " kotlin-android" , " kotlin-platform-jvm" ).any { plugins.hasPlugin(it) }
44+
45+ fun Project.isAndroidProject () = listOf (
46+ " com.android.library" ,
47+ " com.android.application" ,
48+ " com.android.test" ,
49+ " com.android.feature" ,
50+ " com.android.instantapp"
51+ ).any { plugins.hasPlugin(it) }
52+
53+ fun Project.isJsProject () = plugins.hasPlugin(" kotlin2js" )
54+
55+ fun Project.isCommonsProject () = plugins.hasPlugin(" org.jetbrains.kotlin.platform.common" )
3956
4057/* *
4158 * An extension to create test Kotlin source set.
0 commit comments