@@ -38,6 +38,7 @@ pluginManagement {
38
38
.removeSuffix(" /gradle-conventions-settings" )
39
39
.removeSuffix(" /compiler-plugin" )
40
40
.removeSuffix(" /gradle-plugin" )
41
+ .removeSuffix(" /dokka-plugin" )
41
42
)
42
43
val localFile = File (propertiesDir, " local.properties" )
43
44
if (localFile.exists()) {
@@ -100,94 +101,99 @@ pluginManagement {
100
101
}
101
102
}
102
103
103
- gradle.rootProject {
104
- fun findGlobalRootDirPath (): java.nio.file.Path {
105
- var path = file(" ." ).toPath().toAbsolutePath()
104
+ fun findGlobalRootDirPath (): java.nio.file.Path {
105
+ var path = file(" ." ).toPath().toAbsolutePath()
106
106
107
- // we assume that the 'versions-root' folder can only be present in the root folder
108
- while (
109
- java.nio.file.Files .newDirectoryStream(path).use { it.toList() }.none {
110
- java.nio.file.Files .isDirectory(it) && it.fileName.toString() == " versions-root"
111
- }
112
- ) {
113
- path = path.parent ? : error(" Unable to find root path for kotlinx.rpc project" )
107
+ // we assume that the 'versions-root' folder can only be present in the root folder
108
+ while (
109
+ java.nio.file.Files .newDirectoryStream(path).use { it.toList() }.none {
110
+ java.nio.file.Files .isDirectory(it) && it.fileName.toString() == " versions-root"
114
111
}
115
-
116
- return path
112
+ ) {
113
+ path = path.parent ? : error( " Unable to find root path for kotlinx.rpc project " )
117
114
}
118
115
119
- fun logAbsentProperty ( name : String ): Nothing? {
120
- logger.info( " Property ' $name ' is not present for repository credentials. " )
116
+ return path
117
+ }
121
118
122
- return null
123
- }
119
+ fun logAbsentProperty ( name : String ): Nothing? {
120
+ logger.info( " Property ' $name ' is not present for repository credentials. " )
124
121
125
- fun getEnv (propertyName : String ): String? = System .getenv(
126
- propertyName.replace(" ." , " _" ).uppercase()
127
- )?.ifEmpty { null }
122
+ return null
123
+ }
128
124
129
- fun getLocalProperties (): java.util.Properties {
130
- return java.util.Properties ().apply {
131
- val propertiesDir = File (
132
- rootDir.path
133
- .removeSuffix(" /gradle-conventions" )
134
- .removeSuffix(" /gradle-conventions-settings" )
135
- .removeSuffix(" /compiler-plugin" )
136
- .removeSuffix(" /gradle-plugin" )
137
- )
138
- val localFile = File (propertiesDir, " local.properties" )
139
- if (localFile.exists()) {
140
- localFile.inputStream().use { load(it) }
141
- }
125
+ fun getEnv (propertyName : String ): String? = System .getenv(
126
+ propertyName.replace(" ." , " _" ).uppercase()
127
+ )?.ifEmpty { null }
128
+
129
+ fun getLocalProperties (): java.util.Properties {
130
+ return java.util.Properties ().apply {
131
+ val propertiesDir = File (
132
+ rootDir.path
133
+ .removeSuffix(" /gradle-conventions" )
134
+ .removeSuffix(" /gradle-conventions-settings" )
135
+ .removeSuffix(" /compiler-plugin" )
136
+ .removeSuffix(" /gradle-plugin" )
137
+ .removeSuffix(" /dokka-plugin" )
138
+ )
139
+ val localFile = File (propertiesDir, " local.properties" )
140
+ if (localFile.exists()) {
141
+ localFile.inputStream().use { load(it) }
142
142
}
143
143
}
144
+ }
144
145
145
- fun java.util.Properties.isUsingProxyRepositories (): Boolean {
146
- val useProxyProperty = this [" kotlinx.rpc.useProxyRepositories" ] as String?
147
- return useProxyProperty == null || useProxyProperty == " true"
148
- }
146
+ fun java.util.Properties.isUsingProxyRepositories (): Boolean {
147
+ val useProxyProperty = this [" kotlinx.rpc.useProxyRepositories" ] as String?
148
+ return useProxyProperty == null || useProxyProperty == " true"
149
+ }
149
150
150
- fun getSpacePassword (): String? {
151
- val password = " kotlinx.rpc.team.space.password"
152
- return getLocalProperties()[password] as String?
153
- ? : settings.providers.gradleProperty(password).orNull
154
- ? : getEnv(password)
155
- ? : logAbsentProperty(password)
156
- }
151
+ fun getSpacePassword (): String? {
152
+ val password = " kotlinx.rpc.team.space.password"
153
+ return getLocalProperties()[password] as String?
154
+ ? : settings.providers.gradleProperty(password).orNull
155
+ ? : getEnv(password)
156
+ ? : logAbsentProperty(password)
157
+ }
157
158
158
- /* *
159
- * Creates a publishing repository targeting Space Packages on jetbrains.team.
160
- *
161
- * @param repoName the name of the Space Packages repository
162
- */
163
- fun RepositoryHandler.jbTeamPackages (repoName : String ) {
164
- maven {
165
- name = repoName.split(" -" ).joinToString(" " ) { it.replaceFirstChar { c -> c.titlecase() } }
166
- url = uri(" https://packages.jetbrains.team/maven/p/krpc/$repoName " )
159
+ /* *
160
+ * Creates a publishing repository targeting Space Packages on jetbrains.team.
161
+ *
162
+ * @param repoName the name of the Space Packages repository
163
+ */
164
+ fun RepositoryHandler.jbTeamPackages (repoName : String ) {
165
+ maven {
166
+ name = repoName.split(" -" ).joinToString(" " ) { it.replaceFirstChar { c -> c.titlecase() } }
167
+ url = uri(" https://packages.jetbrains.team/maven/p/krpc/$repoName " )
167
168
168
- val spacePassword = getSpacePassword()
169
+ val spacePassword = getSpacePassword()
169
170
170
- if (spacePassword != null ) {
171
- credentials(HttpHeaderCredentials ::class .java) {
172
- name = " Authorization"
173
- value = " Bearer $spacePassword "
174
- }
171
+ if (spacePassword != null ) {
172
+ credentials(HttpHeaderCredentials ::class .java) {
173
+ name = " Authorization"
174
+ value = " Bearer $spacePassword "
175
+ }
175
176
176
- authentication {
177
- create<HttpHeaderAuthentication >(" http_auth_header" )
178
- }
179
- } else {
180
- logger.info(" Skipping adding credentials for Space repository '$repoName '" )
177
+ authentication {
178
+ create<HttpHeaderAuthentication >(" http_auth_header" )
181
179
}
180
+ } else {
181
+ logger.info(" Skipping adding credentials for Space repository '$repoName '" )
182
182
}
183
183
}
184
+ }
184
185
185
- fun RepositoryHandler.buildDeps () = jbTeamPackages(repoName = " build-deps" )
186
- fun RepositoryHandler.buildDepsEap () = jbTeamPackages(repoName = " build-deps-eap" )
186
+ fun RepositoryHandler.buildDeps () = jbTeamPackages(repoName = " build-deps" )
187
+ fun RepositoryHandler.buildDepsEap () = jbTeamPackages(repoName = " build-deps-eap" )
187
188
188
- allprojects {
189
- val localProps = getLocalProperties()
189
+ val localProps = getLocalProperties()
190
+
191
+ settings.extra[" spacePassword" ] = getSpacePassword()
192
+ settings.extra[" localProperties" ] = localProps
193
+ settings.extra[" useProxyRepositories" ] = localProps.isUsingProxyRepositories()
190
194
195
+ gradle.rootProject {
196
+ allprojects {
191
197
this .extra[" spacePassword" ] = getSpacePassword()
192
198
this .extra[" localProperties" ] = localProps
193
199
this .extra[" useProxyRepositories" ] = localProps.isUsingProxyRepositories()
0 commit comments