Skip to content

Commit 3962222

Browse files
committed
code
1 parent 66acffa commit 3962222

6 files changed

Lines changed: 36 additions & 46 deletions

File tree

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,42 @@ plugins {
1313
id("com.android.application").apply(false)
1414
id("com.android.library").apply(false)
1515
id("org.jetbrains.compose").apply(false)
16+
id("maven-publish")
1617
id("org.jetbrains.dokka")
1718
}
1819

1920
tasks.withType<org.jetbrains.dokka.gradle.DokkaMultiModuleTask>(){
2021
outputDirectory.set(rootProject.file("docs/api"))
2122
}
2223

24+
fun RepositoryHandler.githubPackages() {
25+
maven("https://maven.pkg.github.com/Qawaz/compose-code-editor") {
26+
name = "GithubPackages"
27+
try {
28+
credentials {
29+
username = (System.getenv("GPR_USER")).toString()
30+
password = (System.getenv("GPR_API_KEY")).toString()
31+
}
32+
} catch (ex: Exception) {
33+
ex.printStackTrace()
34+
}
35+
}
36+
}
37+
38+
subprojects {
39+
apply(plugin = "maven-publish")
40+
publishing {
41+
repositories {
42+
githubPackages()
43+
}
44+
}
45+
}
46+
2347
allprojects {
2448
repositories {
2549
google()
2650
mavenCentral()
2751
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
52+
githubPackages()
2853
}
2954
}

codeeditor/build.gradle.kts

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -72,44 +72,4 @@ android {
7272
sourceCompatibility = JavaVersion.VERSION_1_8
7373
targetCompatibility = JavaVersion.VERSION_1_8
7474
}
75-
}
76-
77-
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-
87-
publishing {
88-
repositories {
89-
maven {
90-
name = "GithubPackages"
91-
url = uri("https://maven.pkg.github.com/Qawaz/compose-code-editor")
92-
try {
93-
credentials {
94-
username = (githubProperties["gpr.usr"] ?: System.getenv("GPR_USER")).toString()
95-
password = (githubProperties["gpr.key"] ?: System.getenv("GPR_API_KEY")).toString()
96-
}
97-
} catch (ex: Exception) {
98-
ex.printStackTrace()
99-
}
100-
}
101-
}
102-
}
103-
}
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-
}
75+
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
kotlin.code.style=official
22
android.useAndroidX=true
33

4-
version=3.1.1
4+
version=3.1.2
55
versionCode=2
6-
kotlin.version=1.8.0
6+
kotlin.version=1.8.20
77
agp.version=7.3.1
8-
compose.version=1.3.0
8+
compose.version=1.4.0
99

1010
org.jetbrains.compose.experimental.jscanvas.enabled=true
1111
kotlin.mpp.androidSourceSetLayoutVersion=2

0 commit comments

Comments
 (0)