2
0
Эх сурвалжийг харах

autoupdate docs by xmake-repo/ci

ruki 3 жил өмнө
parent
commit
e00e8e7a67

+ 33 - 7
mirror/getting_started.html

@@ -213,15 +213,41 @@ $ xrepo install conan::zlib/1.2.11
    _ = "/mnt/xmake/scripts/xrepo.sh"
 }
 </code></pre>
-<h3 id="loadpackageenvironmentandruncommands">Load package environment and run commands</h3>
-<pre><code class="lang-console">$ xrepo env luajit
-LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
-JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
->
+<h3 id="packagevirtualenvironment">Package virtual environment</h3>
+<h4 id="enterthevirtualenvironment">Enter the virtual environment</h4>
+<p>We can customize some package configurations by adding the xmake.lua file in the current directory, and then enter the specific package virtual environment.</p>
+<pre><code class="lang-lua">add_requires("zlib 1.2.11")
+add_requires("python 3.x", "luajit")
 </code></pre>
-<pre><code class="lang-console">$ xrepo env -b "luajit 2.x" luajit
-$ xrepo env -p iphoneos -b "zlib,libpng,luajit 2.x" cmake ..
+<pre><code class="lang-console">$ xrepo env shell
+> python --version
+> luajit --version
 </code></pre>
+<p>We can also configure and load the corresponding toolchain environment in xmake.lua, for example, load the VS compilation environment.</p>
+<pre><code class="lang-lua">set_toolchains("msvc")
+</code></pre>
+<h4 id="managevirtualenvironments">Manage virtual environments</h4>
+<p>We can use the following command to register the specified virtual environment configuration globally to the system for quick switching.</p>
+<pre><code class="lang-console">$ xrepo env --add /tmp/base.lua
+</code></pre>
+<p>At this time, we have saved a global virtual environment called base, and we can view it through the list command.</p>
+<pre><code class="lang-console">$ xrepo env --list
+/Users/ruki/.xmake/envs:
+  -base
+envs(1) found!
+</code></pre>
+<p>We can also delete it.</p>
+<pre><code class="lang-console">$ xrepo env --remove base
+</code></pre>
+<h4 id="switchglobalvirtualenvironment">Switch global virtual environment</h4>
+<p>If we register multiple virtual environments, we can also switch them quickly.</p>
+<pre><code class="lang-console">$ xrepo env -b base shell
+> python --version
+</code></pre>
+<p>Or directly load the specified virtual environment to run specific commands</p>
+<pre><code class="lang-console">$ xrepo env -b base python --version
+</code></pre>
+<p><code>xrepo env -b/--bind</code> is to bind the specified virtual environment. For more details, see: <a href="https://github.com/xmake-io/xmake/issues/1762">#1762</a></p>
 <h3 id="showthegivenpackageinformation">Show the given package information</h3>
 <pre><code class="lang-console">$ xrepo info zlib
 The package info of project:

+ 33 - 7
mirror/zh-cn/getting_started.html

@@ -213,15 +213,41 @@ $ xrepo install conan::zlib/1.2.11
   _ = "/mnt/xmake/scripts/xrepo.sh"
 }
 </code></pre>
-<h3 id="">加载执行包环境并运行命令</h3>
-<pre><code class="lang-console">$ xrepo env luajit
-LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
-JIT: ON SSE2 SSE3 SSE4.1 BMI2 fold cse dce fwd dse narrow loop abc sink fuse
->
+<h3 id="">包虚拟环境</h3>
+<h4 id="">进入虚拟环境</h4>
+<p>我们可以通过在当前目录下,添加 xmake.lua 文件,定制化一些包配置,然后进入特定的包虚拟环境。</p>
+<pre><code class="lang-lua">add_requires("zlib 1.2.11")
+add_requires("python 3.x", "luajit")
 </code></pre>
-<pre><code class="lang-console">$ xrepo env -b "luajit 2.x" luajit
-$ xrepo env -p iphoneos -b "zlib,libpng,luajit 2.x" cmake ..
+<pre><code class="lang-console">$ xrepo env shell
+> python --version
+> luajit --version
 </code></pre>
+<p>我们也可以在 xmake.lua 配置加载对应的工具链环境,比如加载 vs 的编译环境。</p>
+<pre><code class="lang-lua">set_toolchains("msvc")
+</code></pre>
+<h4 id="">管理虚拟环境</h4>
+<p>我们可以使用下面的命令,把指定的虚拟环境配置全局注册到系统中,方便快速切换。</p>
+<pre><code class="lang-console">$ xrepo env --add /tmp/base.lua
+</code></pre>
+<p>这个时候,我们就保存了一个名叫 base 的全局虚拟环境,我们可以通过 list 命令去查看它。</p>
+<pre><code class="lang-console">$ xrepo env --list
+/Users/ruki/.xmake/envs:
+  - base
+envs(1) found!
+</code></pre>
+<p>我们也可以删除它。</p>
+<pre><code class="lang-console">$ xrepo env --remove base
+</code></pre>
+<h4 id="">切换全局虚拟环境</h4>
+<p>如果我们注册了多个虚拟环境,我们也可以快速切换它们。</p>
+<pre><code class="lang-console">$ xrepo env -b base shell
+> python --version
+</code></pre>
+<p>或者直接加载指定虚拟环境运行特定命令</p>
+<pre><code class="lang-console">$ xrepo env -b base python --version
+</code></pre>
+<p><code>xrepo env -b/--bind</code> 就是绑定指定的虚拟环境,更多详情见:<a href="https://github.com/xmake-io/xmake/issues/1762">#1762</a></p>
 <h3 id="">查看包信息</h3>
 <pre><code class="lang-console">$ xrepo info zlib
 The package info of project:

+ 14 - 14
sitemap.xml

@@ -7,72 +7,72 @@
     
 <url>
   <loc>https://xrepo.xmake.io</loc>
-  <lastmod>2021-10-28T11:55:01+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:03+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/index.html</loc>
-  <lastmod>2021-10-28T11:55:03+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2021-10-28T11:55:04+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2021-10-28T11:55:04+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:05+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2021-10-28T11:55:04+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/cross.html</loc>
-  <lastmod>2021-10-28T11:55:04+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/mingw.html</loc>
-  <lastmod>2021-10-28T11:55:04+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/android.html</loc>
-  <lastmod>2021-10-28T11:55:04+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:06+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/bsd.html</loc>
-  <lastmod>2021-10-28T11:55:05+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/msys.html</loc>
-  <lastmod>2021-10-28T11:55:05+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/macosx.html</loc>
-  <lastmod>2021-10-28T11:55:05+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:07+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/iphoneos.html</loc>
-  <lastmod>2021-10-28T11:55:05+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/linux.html</loc>
-  <lastmod>2021-10-28T11:55:06+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:08+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xrepo.xmake.io/mirror/packages/windows.html</loc>
-  <lastmod>2021-10-28T11:55:06+08:00</lastmod>
+  <lastmod>2021-10-31T12:14:08+08:00</lastmod>
 </url>
 
 </urlset>