11@file:Suppress(" UnstableApiUsage" )
22
3+ import com.mooltiverse.oss.nyx.gradle.NyxExtension
4+ import com.mooltiverse.oss.nyx.services.github.GitHub
5+
36enableFeaturePreview(" TYPESAFE_PROJECT_ACCESSORS" )
47
58pluginManagement {
@@ -11,27 +14,21 @@ pluginManagement {
1114 }
1215}
1316
17+ plugins { id(" com.mooltiverse.oss.nyx" ) version " 1.3.0" }
18+
19+ extensions.configure<NyxExtension > {
20+ configurationFile.set(" .nyx.yml" )
21+ }
22+
1423dependencyResolutionManagement {
1524 repositoriesMode.set(RepositoriesMode .FAIL_ON_PROJECT_REPOS )
1625 repositories {
1726 google()
1827 mavenCentral()
19-
20- maven {
21- url = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
22- }
23-
24- maven {
25- url = uri(" https://jitpack.io" )
26- }
27-
28- maven {
29- url = uri(" https://repo.gradle.org/gradle/libs-releases/" )
30- }
31-
32- maven {
33- url = uri(" https://repo.eclipse.org/content/repositories/lemminx-snapshots/" )
34- }
28+ maven { url = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ) }
29+ maven { url = uri(" https://jitpack.io" ) }
30+ maven { url = uri(" https://repo.gradle.org/gradle/libs-releases/" ) }
31+ maven { url = uri(" https://repo.eclipse.org/content/repositories/lemminx-snapshots/" ) }
3532 }
3633}
3734
@@ -57,15 +54,12 @@ include(
5754 " :treeview" ,
5855 " :uidesigner" ,
5956 " :xml-inflater" ,
60-
6157 " :gradle-plugin" ,
62-
6358 " :lsp:api" ,
6459 " :lsp:models" ,
6560 " :lsp:java" ,
6661 " :lsp:xml" ,
6762 " :lsp:testing" ,
68-
6963 " :subprojects:aaptcompiler" ,
7064 " :subprojects:builder-model-impl" ,
7165 " :subprojects:classfile" ,
@@ -88,3 +82,36 @@ include(
8882 " :subprojects:xml-formatter" ,
8983 " :subprojects:xml-utils"
9084)
85+
86+ /* *
87+ * Information about the CI build.
88+ *
89+ * @author Akash Yadav
90+ */
91+ object CI {
92+
93+ /* * The short commit hash. */
94+ val commitHash by lazy {
95+ val sha = System .getenv(" GITHUB_SHA" ) ? : return @lazy " "
96+ shortSha(sha)
97+ }
98+
99+ /* * Name of the current branch. */
100+ val branchName by lazy {
101+ System .getenv(" GITHUB_REF_NAME" ) ? : " main" // by default, 'main'
102+ }
103+
104+ /* * Whether the current build is a CI build. */
105+ val isCiBuild by lazy { " true" == System .getenv(" CI" ) }
106+
107+ private fun shortSha (sha : String ): String {
108+ return ProcessBuilder (" git" , " rev-parse" , " --short" , sha)
109+ .directory(File (" ." ))
110+ .redirectErrorStream(true )
111+ .start()
112+ .inputStream
113+ .bufferedReader()
114+ .readText()
115+ .trim()
116+ }
117+ }
0 commit comments