mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-19 06:09:37 +08:00
Implement Clojure
recipe
This commit is contained in:
parent
56e0907609
commit
4686f71cde
@ -4,18 +4,23 @@
|
||||
* File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||
* Contributors : Nil Null <nil@null.org>
|
||||
* Created On : <2023-09-10>
|
||||
* Last Modified : <2024-08-09>
|
||||
* Last Modified : <2025-07-14>
|
||||
* ------------------------------------------------------------*/
|
||||
|
||||
#include "rawstr4c.h"
|
||||
|
||||
/**
|
||||
* @update 2023-09-10
|
||||
* @note 不太好换,且用户可能不多,我们暂时只给用户提供文档
|
||||
* @update 2025-07-14
|
||||
*/
|
||||
static Source_t pl_clojure_sources[] =
|
||||
{
|
||||
{&UpstreamProvider, NULL},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/help/clojars/"},
|
||||
{&Ustc, "https://mirrors.ustc.edu.cn/help/clojars.html"}
|
||||
{&UpstreamProvider, NULL, NULL},
|
||||
{&MirrorZ, "https://mirrors.cernet.edu.cn/clojars/", DelegateToMirror},
|
||||
{&Tuna, "https://mirrors.tuna.tsinghua.edu.cn/clojars/", DelegateToMirror},
|
||||
{&Nju, "https://mirror.nju.edu.cn/clojars/", DelegateToMirror},
|
||||
{&Nyist, "https://mirror.nyist.edu.cn/clojars/", DelegateToMirror},
|
||||
{&Ustc, "https://mirrors.ustc.edu.cn/clojars/", DelegateToMirror},
|
||||
{&Iscas, "https://mirror.iscas.ac.cn/clojars/", DelegateToMirror}
|
||||
};
|
||||
def_sources_n(pl_clojure);
|
||||
|
||||
@ -25,11 +30,43 @@ pl_clojure_setsrc (char *option)
|
||||
{
|
||||
chsrc_yield_source_and_confirm (pl_clojure);
|
||||
|
||||
chsrc_note2 ("抱歉,Clojure换源较复杂,可手动查阅并换源:");
|
||||
p(source.url);
|
||||
if (chsrc_in_local_mode())
|
||||
{
|
||||
chsrc_note2 ("请在项目根目录中的 project.clj 中手动添加 :mirrors 关键字:");
|
||||
char *config = xy_str_gsub (RAWSTR_pl_project_clj, "@url@", source.url);
|
||||
println (config);
|
||||
}
|
||||
else
|
||||
{
|
||||
chsrc_note2 ("请在 ~/.lein/projfiles.clj 中手动添加 :mirrors 关键字:");
|
||||
char *config = xy_str_gsub (RAWSTR_pl_projfiles_clj, "@url@", source.url);
|
||||
println (config);
|
||||
}
|
||||
|
||||
chsrc_determine_chgtype (ChgType_Manual);
|
||||
chsrc_conclude (&source);
|
||||
}
|
||||
|
||||
def_target_s (pl_clojure);
|
||||
|
||||
/**
|
||||
* chsrc ls clojure
|
||||
*/
|
||||
Feature_t
|
||||
pl_clojure_feat (char *option)
|
||||
{
|
||||
Feature_t f = {0};
|
||||
|
||||
f.can_get = false;
|
||||
f.can_reset = false;
|
||||
|
||||
f.cap_locally = CanNot;
|
||||
f.cap_locally_explain = NULL;
|
||||
f.can_english = false;
|
||||
|
||||
f.can_user_define = true;
|
||||
|
||||
f.note = NULL;
|
||||
return f;
|
||||
}
|
||||
|
||||
def_target_sf(pl_clojure);
|
||||
|
12
src/recipe/lang/rawstr4c.h
Normal file
12
src/recipe/lang/rawstr4c.h
Normal file
@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Generated by rawstr4c v0.1.0.2-2025/07/14
|
||||
*
|
||||
* Date: 2025-07-14T23:22:27.033387+08:00
|
||||
*/
|
||||
|
||||
char RAWSTR_pl_project_clj[] = "\050\144\145\146\160\162\157\152\145\143\164\040\155\171\141\160\160\040\042\061\056\060\056\060\042\012\040\040\040\072\144\145\163\143\162\151\160\164\151\157\156\040\042\115\171\040\101\160\160\154\151\143\141\164\151\157\156\042\012\040\040\040\072\144\145\160\145\156\144\145\156\143\151\145\163\040\133\133\154\151\142\061\040\042\061\056\060\056\060\042\135\012\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\133\154\151\142\062\040\042\062\056\060\056\060\042\135\012\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\133\154\151\142\063\040\042\063\056\060\056\060\042\135\135\012\040\040\040\072\155\151\162\162\157\162\163\040\173\042\143\154\157\152\141\162\163\042\040\173\072\156\141\155\145\040\042\155\151\162\162\157\162\042\012\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\040\072\165\162\154\040\042\100\165\162\154\100\042\175\175\012\040\040\040\072\155\141\151\156\040\154\145\151\156\151\156\147\145\156\056\167\145\142\051\012";
|
||||
|
||||
char RAWSTR_pl_projfiles_clj[] = "\072\165\163\145\162\040\173\072\162\145\160\157\163\151\164\157\162\151\145\163\040\133\133\042\143\154\157\152\141\162\163\042\040\173\072\165\162\154\040\042\100\165\162\154\100\042\175\135\135\012\040\040\040\040\040\040\040\073\073\040\157\164\150\145\162\040\072\165\163\145\162\040\160\162\157\146\151\154\145\040\163\145\164\164\151\156\147\163\012\040\040\040\040\040\040\175\012";
|
||||
|
40
src/recipe/lang/rawstr4c.md
Normal file
40
src/recipe/lang/rawstr4c.md
Normal file
@ -0,0 +1,40 @@
|
||||
<!-- -----------------------------------------------------------
|
||||
! SPDX-License-Identifier: GPL-3.0-or-later
|
||||
! -------------------------------------------------------------
|
||||
! Config Type : rawstr4c (Markdown)
|
||||
! Config Authors: Aoran Zeng <ccmywish@qq.com>
|
||||
! Contributors : Nil Null <nil@null.org>
|
||||
! Created On : <2025-07-14>
|
||||
! Last Modified : <2025-07-14>
|
||||
! ---------------------------------------------------------- -->
|
||||
|
||||
# rawstr4c input
|
||||
|
||||
- prefix = `RAWSTR_pl`
|
||||
- output = `:global-variable-only-header`
|
||||
- translate = `:oct`
|
||||
|
||||
## Clojar
|
||||
|
||||
### project.clj
|
||||
|
||||
```clojure
|
||||
(defproject myapp "1.0.0"
|
||||
:description "My Application"
|
||||
:dependencies [[lib1 "1.0.0"]
|
||||
[lib2 "2.0.0"]
|
||||
[lib3 "3.0.0"]]
|
||||
:mirrors {"clojars" {:name "mirror"
|
||||
:url "@url@"}}
|
||||
:main leiningen.web)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### projfiles.clj
|
||||
|
||||
```clojure
|
||||
:user {:repositories [["clojars" {:url "@url@"}]]
|
||||
;; other :user profile settings
|
||||
}
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user