mirror of
https://github.com/HighCapable/YukiHookAPI-ProjectBuilder.git
synced 2025-12-07 21:53:44 +08:00
refactor: replace SweetProperty with Gropify support and use version catalog instead SweetDependency
This commit is contained in:
Binary file not shown.
@@ -47,8 +47,7 @@ const dependenciesConfigs = {
|
|||||||
gradlePapers: [],
|
gradlePapers: [],
|
||||||
androidGradlePluginVersions: [],
|
androidGradlePluginVersions: [],
|
||||||
kotlinVersions: [],
|
kotlinVersions: [],
|
||||||
sweetDependencyVersions: [],
|
gropifyVersions: [],
|
||||||
sweetPropertyVersions: [],
|
|
||||||
yukiHookApiVersions: []
|
yukiHookApiVersions: []
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -82,8 +81,7 @@ const projectConfigs = {
|
|||||||
androidGradlePluginVersion: '',
|
androidGradlePluginVersion: '',
|
||||||
kotlinVersion: '',
|
kotlinVersion: '',
|
||||||
kotlinKspVersion: '',
|
kotlinKspVersion: '',
|
||||||
sweetDependencyVersion: '',
|
gropifyVersion: '',
|
||||||
sweetPropertyVersion: '',
|
|
||||||
yukiHookApiVersion: ''
|
yukiHookApiVersion: ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -465,8 +463,7 @@ const projectDepends = {
|
|||||||
androidGradlePlugin: 'https://dl.google.com/dl/android/maven2/com/android/application/com.android.application.gradle.plugin/maven-metadata.xml',
|
androidGradlePlugin: 'https://dl.google.com/dl/android/maven2/com/android/application/com.android.application.gradle.plugin/maven-metadata.xml',
|
||||||
kotlin: 'https://api.github.com/repos/JetBrains/kotlin/releases',
|
kotlin: 'https://api.github.com/repos/JetBrains/kotlin/releases',
|
||||||
kotlinKsp: 'https://api.github.com/repos/google/ksp/releases',
|
kotlinKsp: 'https://api.github.com/repos/google/ksp/releases',
|
||||||
sweetDependency: 'https://api.github.com/repos/HighCapable/SweetDependency/releases',
|
gropify: 'https://repo1.maven.org/maven2/com/highcapable/gropify/gropify/maven-metadata.xml',
|
||||||
sweetProperty: 'https://api.github.com/repos/HighCapable/SweetProperty/releases',
|
|
||||||
yukiHookApi: 'https://api.github.com/repos/HighCapable/YuKiHookAPI/releases'
|
yukiHookApi: 'https://api.github.com/repos/HighCapable/YuKiHookAPI/releases'
|
||||||
},
|
},
|
||||||
/** 搜索项目依赖 */
|
/** 搜索项目依赖 */
|
||||||
@@ -571,34 +568,21 @@ const projectDepends = {
|
|||||||
return !valUtils.isEmpty(value.ksp);
|
return !valUtils.isEmpty(value.ksp);
|
||||||
});
|
});
|
||||||
if (dependenciesConfigs.kotlinVersions.length > 0)
|
if (dependenciesConfigs.kotlinVersions.length > 0)
|
||||||
projectDepends.findSweetDependencyVersion();
|
projectDepends.findGropifyVersion();
|
||||||
else projectDepends.failure('Kotlin-Ksp', false);
|
else projectDepends.failure('Kotlin-Ksp', false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 获取 SweetDependency 版本 */
|
/** 获取 Gropify 版本 */
|
||||||
findSweetDependencyVersion: () => {
|
findGropifyVersion: () => {
|
||||||
httpClient.requestDepends('SweetDependency', projectDepends.urls.sweetDependency, (body) => {
|
httpClient.requestDepends('Gropify', projectDepends.urls.gropify, (body) => {
|
||||||
dependenciesConfigs.sweetDependencyVersions = [];
|
dependenciesConfigs.gropifyVersions = [];
|
||||||
const latestVersion = body.length > 0 ? body[0]['tag_name'] : '';
|
const latestVersion = $(body).find('latest').text();
|
||||||
if (latestVersion !== '') {
|
if (latestVersion !== '') {
|
||||||
dependenciesConfigs.sweetDependencyVersions.push(latestVersion);
|
dependenciesConfigs.gropifyVersions.push(latestVersion);
|
||||||
/** 直接设置为最新版本 */
|
/** 直接设置为最新版本 */
|
||||||
projectConfigs.projectDependencies.sweetDependencyVersion = latestVersion;
|
projectConfigs.projectDependencies.gropifyVersion = latestVersion;
|
||||||
projectDepends.findSweetPropertyVersion();
|
|
||||||
} else projectDepends.failure('SweetDependency', false);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 获取 SweetProperty 版本 */
|
|
||||||
findSweetPropertyVersion: () => {
|
|
||||||
httpClient.requestDepends('SweetProperty', projectDepends.urls.sweetProperty, (body) => {
|
|
||||||
dependenciesConfigs.sweetPropertyVersions = [];
|
|
||||||
const latestVersion = body.length > 0 ? body[0]['tag_name'] : '';
|
|
||||||
if (latestVersion !== '') {
|
|
||||||
dependenciesConfigs.sweetPropertyVersions.push(latestVersion);
|
|
||||||
/** 直接设置为最新版本 */
|
|
||||||
projectConfigs.projectDependencies.sweetPropertyVersion = latestVersion;
|
|
||||||
projectDepends.findYukiHookApiVersion();
|
projectDepends.findYukiHookApiVersion();
|
||||||
} else projectDepends.failure('SweetProperty', false);
|
} else projectDepends.failure('Gropify', false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 获取 YukiHookAPI 版本 */
|
/** 获取 YukiHookAPI 版本 */
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ const transaction = {
|
|||||||
codeFiles['HookEntry.kt'].configs.enableYChannel(configs.yukiHookApiConfig.enableYChannel === 1));
|
codeFiles['HookEntry.kt'].configs.enableYChannel(configs.yukiHookApiConfig.enableYChannel === 1));
|
||||||
hookEntryConfigsCode = hookEntryConfigsCode.trim();
|
hookEntryConfigsCode = hookEntryConfigsCode.trim();
|
||||||
if (hookEntryConfigsCode === '') hookEntryConfigsCode = '// Your code here.';
|
if (hookEntryConfigsCode === '') hookEntryConfigsCode = '// Your code here.';
|
||||||
fileSystem.replaces(targetPath, ['gradle.kts', 'properties', 'kt', 'xml', 'yaml'], [
|
fileSystem.replaces(targetPath, ['gradle.kts', 'properties', 'kt', 'xml', 'toml'], [
|
||||||
{
|
{
|
||||||
placeholder: '{GRADLE_PAPER}',
|
placeholder: '{GRADLE_PAPER}',
|
||||||
value: configs.projectDependencies.gradlePaper
|
value: configs.projectDependencies.gradlePaper
|
||||||
@@ -284,11 +284,8 @@ const transaction = {
|
|||||||
placeholder: '{GRADLE_PROPERTIES_DATE}',
|
placeholder: '{GRADLE_PROPERTIES_DATE}',
|
||||||
value: dateTime.cstTime()
|
value: dateTime.cstTime()
|
||||||
}, {
|
}, {
|
||||||
placeholder: '{SWEETDEPENDENCY_VERSION}',
|
placeholder: '{GROPIFY_VERSION}',
|
||||||
value: configs.projectDependencies.sweetDependencyVersion
|
value: configs.projectDependencies.gropifyVersion
|
||||||
}, {
|
|
||||||
placeholder: '{SWEETPROPERTY_VERSION}',
|
|
||||||
value: configs.projectDependencies.sweetPropertyVersion
|
|
||||||
}, {
|
}, {
|
||||||
placeholder: '{AGP_VERSION}',
|
placeholder: '{AGP_VERSION}',
|
||||||
value: configs.projectDependencies.androidGradlePluginVersion
|
value: configs.projectDependencies.androidGradlePluginVersion
|
||||||
|
|||||||
Reference in New Issue
Block a user