Skip to content

Commit 4abd04f

Browse files
authored
Merge pull request #14 from esafirm/main
Feature/web target (#1)
2 parents 85ab7bd + 52c6e86 commit 4abd04f

File tree

21 files changed

+4655
-88
lines changed

21 files changed

+4655
-88
lines changed
-17 Bytes
Binary file not shown.

.gradle/buildOutputCleanup/cache.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.
-296 KB
Binary file not shown.

.gradle/checksums/checksums.lock

-17 Bytes
Binary file not shown.
-39.5 KB
Binary file not shown.
-151 KB
Binary file not shown.
-19.7 KB
Binary file not shown.
-20.5 KB
Binary file not shown.

.gradle/vcs-1/gc.properties

Whitespace-only changes.

codeeditor/build.gradle.kts

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import java.io.FileInputStream
2-
import java.util.*
1+
import java.util.Properties
32

43
plugins {
54
kotlin("multiplatform")
@@ -21,6 +20,10 @@ kotlin {
2120
kotlinOptions.jvmTarget = "11"
2221
}
2322
}
23+
js(IR) {
24+
browser()
25+
binaries.executable()
26+
}
2427
sourceSets {
2528
val commonMain by getting {
2629
dependencies {
@@ -49,6 +52,12 @@ kotlin {
4952
}
5053
}
5154
val desktopTest by getting
55+
56+
named("jsMain") {
57+
dependencies {
58+
api(compose.web.core)
59+
}
60+
}
5261
}
5362
}
5463

@@ -65,28 +74,42 @@ android {
6574
}
6675
}
6776

68-
val githubProperties = Properties()
69-
try {
70-
githubProperties.load(FileInputStream(rootProject.file("github.properties")))
71-
}catch(ex : Exception){
72-
ex.printStackTrace()
73-
}
7477

75-
afterEvaluate {
78+
val propertiesFile = project.rootProject.file("github.properties")
79+
val isGithubPropAvailable = propertiesFile.exists()
80+
81+
if (isGithubPropAvailable) {
82+
83+
val githubProperties = Properties().apply {
84+
propertiesFile.reader().use { load(it) }
85+
}
86+
7687
publishing {
7788
repositories {
7889
maven {
7990
name = "GithubPackages"
80-
url = uri("https://maven.pkg.github.com/Qawaz/compose-code-editor")
91+
url = uri("https://maven.pkg.github.com/esafirm/compose-code-editor")
8192
try {
8293
credentials {
8394
username = (githubProperties["gpr.usr"] ?: System.getenv("GPR_USER")).toString()
8495
password = (githubProperties["gpr.key"] ?: System.getenv("GPR_API_KEY")).toString()
8596
}
86-
}catch(ex : Exception){
97+
} catch (ex: Exception) {
8798
ex.printStackTrace()
8899
}
89100
}
90101
}
91102
}
92103
}
104+
105+
val checkGithubTask = tasks.register("checkGithubProperties") {
106+
doLast {
107+
if (!isGithubPropAvailable) {
108+
error("Github properties file is not available. Throwing error.")
109+
}
110+
}
111+
}
112+
113+
tasks.withType(PublishToMavenRepository::class.java).configureEach {
114+
dependsOn(checkGithubTask)
115+
}

0 commit comments

Comments
 (0)