mirror of
https://github.com/RubyMetric/chsrc
synced 2025-10-20 18:05:08 +08:00
Update pl recipes using chef DSL
This commit is contained in:
@@ -1,42 +1,50 @@
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : czyt <czyt.go@gmail.com>
|
||||
* | MadDogOwner <xiaoran@xrgzs.top>
|
||||
* |
|
||||
* Created On : <2023-09-10>
|
||||
* Major Revision : 2
|
||||
* Last Modified : <2025-07-11>
|
||||
*
|
||||
* 2024-09-14: 不得不将Dart和Flutter拆分为两个Target,
|
||||
* 因为3家教育网镜像站给出的 Dart 和 Flutter 换源URL模式都不一样
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
#define PL_Dart_Flutter_Speed_URL_Postfix "/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz"
|
||||
|
||||
/**
|
||||
* @update 2025-04-15
|
||||
*/
|
||||
static SourceProvider_t pl_dart_flutter_upstream =
|
||||
def_target(pl_dart_flutter);
|
||||
|
||||
void
|
||||
pl_dart_flutter_prelude (void)
|
||||
{
|
||||
def_upstream, "https://storage.googleapis.com",
|
||||
{NotSkip, NA, NA, "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_v1.0.0-stable.tar.xz", ACCURATE} // 231 MB
|
||||
};
|
||||
use_this(pl_dart_flutter);
|
||||
|
||||
static Source_t pl_dart_flutter_sources[] =
|
||||
{
|
||||
{&pl_dart_flutter_upstream, "https://storage.googleapis.com", DelegateToUpstream},
|
||||
{&FlutterCN, "https://storage.flutter-io.cn", DelegateToMirror},
|
||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn", NULL }, /* 官方文档也没有给后缀,怀疑是否存在问题 */
|
||||
chef_set_created_on (this, "2023-09-10");
|
||||
chef_set_last_updated (this, "2025-07-11");
|
||||
chef_set_sources_last_updated (this, "2025-04-15");
|
||||
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/flutter",
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix},
|
||||
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
|
||||
chef_set_chef (this, NULL, NULL);
|
||||
chef_set_sous_chefs (this, 0);
|
||||
chef_set_contributors (this, 2,
|
||||
"czyt", "czyt.go@gmail.com",
|
||||
"MadDogOwner", "xiaoran@xrgzs.top");
|
||||
|
||||
{&Nju, "https://mirror.nju.edu.cn/flutter",
|
||||
"https://mirror.nju.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix}
|
||||
};
|
||||
def_sources_n(pl_dart_flutter);
|
||||
chef_allow_get();
|
||||
chef_allow_set();
|
||||
chef_allow_reset();
|
||||
|
||||
chef_forbid_local_mode (this);
|
||||
chef_allow_english(this);
|
||||
chef_allow_user_define(this);
|
||||
|
||||
chef_set_note ("2024-09-14: 不得不将Dart和Flutter拆分为两个Target,因为3家教育网镜像站给出的 Dart 和 Flutter 换源URL模式都不一样",
|
||||
"2024-09-14: Had to split Dart and Flutter into two Targets, because the 3 educational network mirror sites have different URL patterns for Dart and Flutter source switching");
|
||||
|
||||
def_sources_begin()
|
||||
{&upstream, "https://storage.googleapis.com", "https://storage.googleapis.com" PL_Dart_Flutter_Speed_URL_Postfix},
|
||||
{&FlutterCN, "https://storage.flutter-io.cn", DelegateToMirror},
|
||||
{&Sjtug_Zhiyuan, "https://mirror.sjtu.edu.cn", NULL }, /* 官方文档也没有给后缀,怀疑是否存在问题 */
|
||||
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/flutter",
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix},
|
||||
|
||||
{&Nju, "https://mirror.nju.edu.cn/flutter",
|
||||
"https://mirror.nju.edu.cn/flutter" PL_Dart_Flutter_Speed_URL_Postfix}
|
||||
def_sources_end()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -92,27 +100,3 @@ pl_dart_flutter_resetsrc (char *option)
|
||||
{
|
||||
pl_dart_flutter_setsrc (option);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* chsrc ls flutter
|
||||
*/
|
||||
Feature_t
|
||||
pl_dart_flutter_feat (char *option)
|
||||
{
|
||||
Feature_t f = {0};
|
||||
|
||||
f.can_get = true;
|
||||
f.can_reset = true;
|
||||
|
||||
f.cap_locally = CanNot;
|
||||
f.cap_locally_explain = NULL;
|
||||
f.can_english = true;
|
||||
|
||||
f.can_user_define = true;
|
||||
|
||||
f.note = "该换源通过写入环境变量实现,若多次换源,请手动清理profile文件";
|
||||
return f;
|
||||
}
|
||||
|
||||
def_target_gsrf(pl_dart_flutter);
|
||||
|
@@ -1,32 +1,37 @@
|
||||
/** ------------------------------------------------------------
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* -------------------------------------------------------------
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : czyt <czyt.go@gmail.com>
|
||||
* | MadDogOwner <xiaoran@xrgzs.top>
|
||||
* |
|
||||
* Created On : <2023-09-10>
|
||||
* Major Revision : 3
|
||||
* Last Modified : <2025-07-11>
|
||||
*
|
||||
* Dart Pub 软件仓库
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
#define PL_Dart_Pub_Speed_URL_Postfix "/packages/flutter_vision/versions/1.1.4.tar.gz"
|
||||
|
||||
/**
|
||||
* @update 2025-04-15
|
||||
*/
|
||||
static SourceProvider_t pl_dart_upstream =
|
||||
{
|
||||
def_upstream, "https://pub.dev",
|
||||
{NotSkip, NA, NA, "https://pub.dev/packages/flutter_vision/versions/1.1.4.tar.gz", ACCURATE} // 37.05 MB
|
||||
};
|
||||
def_target(pl_dart);
|
||||
|
||||
static Source_t pl_dart_sources[] =
|
||||
void
|
||||
pl_dart_prelude (void)
|
||||
{
|
||||
{&pl_dart_upstream, "https://pub.dev", DelegateToUpstream},
|
||||
use_this(pl_dart);
|
||||
|
||||
chef_set_created_on (this, "2023-09-10");
|
||||
chef_set_last_updated (this, "2025-07-11");
|
||||
chef_set_sources_last_updated (this, "2025-04-15");
|
||||
|
||||
chef_set_authors (this, 1, "Aoran Zeng", "ccmywish@qq.com");
|
||||
chef_set_chef (this, NULL, NULL);
|
||||
chef_set_sous_chefs (this, 0);
|
||||
chef_set_contributors (this, 2,
|
||||
"czyt", "czyt.go@gmail.com",
|
||||
"MadDogOwner", "xiaoran@xrgzs.top");
|
||||
|
||||
chef_allow_get();
|
||||
chef_allow_set();
|
||||
chef_allow_reset();
|
||||
|
||||
chef_allow_local_mode (this, FullyCan, "Pub 支持项目级换源", "Pub supports project-level source changing");
|
||||
chef_allow_english(this);
|
||||
chef_allow_user_define(this);
|
||||
|
||||
def_sources_begin()
|
||||
{&upstream, "https://pub.dev", "https://pub.dev" PL_Dart_Pub_Speed_URL_Postfix},
|
||||
{&FlutterCN, "https://pub.flutter-io.cn",
|
||||
"https://pub.flutter-io.cn" PL_Dart_Pub_Speed_URL_Postfix},
|
||||
|
||||
@@ -38,8 +43,8 @@ static Source_t pl_dart_sources[] =
|
||||
|
||||
{&Nju, "https://mirror.nju.edu.cn/dart-pub",
|
||||
"https://mirror.nju.edu.cn/dart-pub" PL_Dart_Pub_Speed_URL_Postfix}
|
||||
};
|
||||
def_sources_n(pl_dart);
|
||||
def_sources_end()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
@@ -92,24 +97,3 @@ pl_dart_resetsrc (char *option)
|
||||
{
|
||||
pl_dart_setsrc (option);
|
||||
}
|
||||
|
||||
|
||||
Feature_t
|
||||
pl_dart_feat (char *option)
|
||||
{
|
||||
Feature_t f = {0};
|
||||
|
||||
f.can_get = true;
|
||||
f.can_reset = true;
|
||||
|
||||
f.cap_locally = CanNot;
|
||||
f.cap_locally_explain = NULL;
|
||||
f.can_english = true;
|
||||
|
||||
f.can_user_define = true;
|
||||
|
||||
f.note = "该换源通过写入环境变量实现,若多次换源,请手动清理profile文件";
|
||||
return f;
|
||||
}
|
||||
|
||||
def_target_gsrf(pl_dart);
|
||||
|
Reference in New Issue
Block a user