mirror of
https://github.com/HighCapable/YukiHookAPI-ProjectBuilder.git
synced 2025-09-01 08:15:27 +08:00
feat: add SweetDependency, SweetProperty version find
This commit is contained in:
@@ -47,6 +47,8 @@ const dependenciesConfigs = {
|
|||||||
gradlePapers: [],
|
gradlePapers: [],
|
||||||
androidGradlePluginVersions: [],
|
androidGradlePluginVersions: [],
|
||||||
kotlinVersions: [],
|
kotlinVersions: [],
|
||||||
|
sweetDependencyVersions: [],
|
||||||
|
sweetPropertyVersions: [],
|
||||||
yukiHookApiVersions: []
|
yukiHookApiVersions: []
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -80,6 +82,8 @@ const projectConfigs = {
|
|||||||
androidGradlePluginVersion: '',
|
androidGradlePluginVersion: '',
|
||||||
kotlinVersion: '',
|
kotlinVersion: '',
|
||||||
kotlinKspVersion: '',
|
kotlinKspVersion: '',
|
||||||
|
sweetDependencyVersion: '',
|
||||||
|
sweetPropertyVersion: '',
|
||||||
yukiHookApiVersion: ''
|
yukiHookApiVersion: ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -461,6 +465,8 @@ 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',
|
||||||
|
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'
|
||||||
},
|
},
|
||||||
/** 搜索项目依赖 */
|
/** 搜索项目依赖 */
|
||||||
@@ -565,10 +571,36 @@ const projectDepends = {
|
|||||||
return !valUtils.isEmpty(value.ksp);
|
return !valUtils.isEmpty(value.ksp);
|
||||||
});
|
});
|
||||||
if (dependenciesConfigs.kotlinVersions.length > 0)
|
if (dependenciesConfigs.kotlinVersions.length > 0)
|
||||||
projectDepends.findYukiHookApiVersion();
|
projectDepends.findSweetDependencyVersion();
|
||||||
else projectDepends.failure('Kotlin-Ksp', false);
|
else projectDepends.failure('Kotlin-Ksp', false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 获取 SweetDependency 版本 */
|
||||||
|
findSweetDependencyVersion: () => {
|
||||||
|
httpClient.requestDepends('SweetDependency', projectDepends.urls.sweetDependency, (body) => {
|
||||||
|
dependenciesConfigs.sweetDependencyVersions = [];
|
||||||
|
const latestVersion = body.length > 0 ? body[0]['tag_name'] : '';
|
||||||
|
if (latestVersion !== '') {
|
||||||
|
dependenciesConfigs.sweetDependencyVersions.push(latestVersion);
|
||||||
|
/** 直接设置为最新版本 */
|
||||||
|
projectConfigs.projectDependencies.sweetDependencyVersion = 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();
|
||||||
|
} else projectDepends.failure('SweetProperty', false);
|
||||||
|
});
|
||||||
|
},
|
||||||
/** 获取 YukiHookAPI 版本 */
|
/** 获取 YukiHookAPI 版本 */
|
||||||
findYukiHookApiVersion: () => {
|
findYukiHookApiVersion: () => {
|
||||||
httpClient.requestDepends('YukiHookAPI', projectDepends.urls.yukiHookApi, (body) => {
|
httpClient.requestDepends('YukiHookAPI', projectDepends.urls.yukiHookApi, (body) => {
|
||||||
|
@@ -142,16 +142,6 @@ const transaction = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Settings 插件命名空间
|
|
||||||
*/
|
|
||||||
const settingsPlugins = {
|
|
||||||
// TODO SweetDependency 和 SweetProperty 暂时不支持自动获取版本
|
|
||||||
// 后期合并到 IDEA 插件后再做这里的更新
|
|
||||||
sweetDependencyVersion: '1.0.2',
|
|
||||||
sweetPropertyVersion: '1.0.3'
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新创建进度显示
|
* 更新创建进度显示
|
||||||
* @param progress 当前进度
|
* @param progress 当前进度
|
||||||
@@ -295,10 +285,10 @@ const transaction = {
|
|||||||
value: dateTime.cstTime()
|
value: dateTime.cstTime()
|
||||||
}, {
|
}, {
|
||||||
placeholder: '{SWEETDEPENDENCY_VERSION}',
|
placeholder: '{SWEETDEPENDENCY_VERSION}',
|
||||||
value: settingsPlugins.sweetDependencyVersion
|
value: configs.projectDependencies.sweetDependencyVersion
|
||||||
}, {
|
}, {
|
||||||
placeholder: '{SWEETPROPERTY_VERSION}',
|
placeholder: '{SWEETPROPERTY_VERSION}',
|
||||||
value: settingsPlugins.sweetPropertyVersion
|
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