|
1 | | -import java.util.Properties |
2 | | - |
3 | 1 | rootProject.name = "hyperskill-plugin" |
4 | 2 | include( |
5 | 3 | "hs-edu-format", |
@@ -31,59 +29,6 @@ include( |
31 | 29 | ) |
32 | 30 |
|
33 | 31 | // Note: hs-remote-env is excluded - doesn't compile with 2025.2+ |
34 | | - |
35 | | -val secretPropertiesFilename: String = "secret.properties" |
36 | | - |
37 | | -configureSecretProperties() |
38 | | - |
39 | | -fun configureSecretProperties() { |
40 | | - val secretProperties = file(secretPropertiesFilename) |
41 | | - if (!secretProperties.exists()) { |
42 | | - secretProperties.createNewFile() |
43 | | - } |
44 | | - |
45 | | - val properties = loadProperties(secretPropertiesFilename) |
46 | | - |
47 | | - properties.extractAndStore( |
48 | | - "intellij-plugin/hs-core/resources/stepik/stepik.properties", |
49 | | - "stepikClientId", |
50 | | - "cogniterraClientId", |
51 | | - ) |
52 | | - properties.extractAndStore( |
53 | | - "intellij-plugin/hs-core/resources/hyperskill/hyperskill-oauth.properties", |
54 | | - "hyperskillClientId", |
55 | | - ) |
56 | | - properties.extractAndStore( |
57 | | - "intellij-plugin/hs-core/resources/twitter/oauth_twitter.properties", |
58 | | - "xClientId" |
59 | | - ) |
60 | | - properties.extractAndStore( |
61 | | - "intellij-plugin/hs-core/resources/linkedin/linkedin-oauth.properties", |
62 | | - "linkedInClientId", |
63 | | - "linkedInClientSecret" |
64 | | - ) |
65 | | - properties.extractAndStore( |
66 | | - "hs-edu-format/resources/aes/aes.properties", |
67 | | - "aesKey" |
68 | | - ) |
69 | | -} |
70 | | - |
71 | | -fun loadProperties(path: String): Properties { |
72 | | - val properties = Properties() |
73 | | - file(path).bufferedReader().use { properties.load(it) } |
74 | | - return properties |
75 | | -} |
76 | | - |
77 | | -fun Properties.extractAndStore(path: String, vararg keys: String) { |
78 | | - val properties = Properties() |
79 | | - for (key in keys) { |
80 | | - properties[key] = getProperty(key) ?: "" |
81 | | - } |
82 | | - val file = file(path) |
83 | | - file.parentFile?.mkdirs() |
84 | | - file.bufferedWriter().use { properties.store(it, "") } |
85 | | -} |
86 | | - |
87 | 32 | // Note: downloadHyperskillCss() was removed from settings.gradle.kts |
88 | 33 | // CSS download is now done lazily in hs-core/build.gradle.kts processResources task |
89 | 34 |
|
|
0 commit comments