import{_ as r,r as o,o as t,c,b as s,d as n,e as a,w as i,a as p}from"./app-mh6GuRj9.js";const d={},u=p('<h1 id="快速开始" tabindex="-1"><a class="header-anchor" href="#快速开始" aria-hidden="true">#</a> 快速开始</h1><blockquote><p>集成 <code>KavaRef</code> 到你的项目中。</p></blockquote><h2 id="项目要求" tabindex="-1"><a class="header-anchor" href="#项目要求" aria-hidden="true">#</a> 项目要求</h2><p>项目需要使用 <code>IntelliJ IDEA</code> 或 <code>Android Studio</code> 创建且类型为 Java 或 Android 项目并已集成 Kotlin 环境依赖。</p>',4),v={href:"https://www.jetbrains.com/idea",target:"_blank",rel:"noopener noreferrer"},y={href:"https://developer.android.com/studio",target:"_blank",rel:"noopener noreferrer"},A=s("li",null,[s("p",null,"Kotlin 1.9.0+、Gradle 8+、Java 17+")],-1),h=s("h3",{id:"配置存储库",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#配置存储库","aria-hidden":"true"},"#"),n(" 配置存储库")],-1),m=s("p",null,[s("code",null,"KavaRef"),n(" 的依赖发布在 "),s("strong",null,"Maven Central"),n(" 和我们的公共存储库中，你可以使用如下方式配置存储库。")],-1),b={href:"https://github.com/HighCapable/SweetDependency",target:"_blank",rel:"noopener noreferrer"},D=p(`<h4 id="sweetdependency-推荐" tabindex="-1"><a class="header-anchor" href="#sweetdependency-推荐" aria-hidden="true">#</a> SweetDependency (推荐)</h4><p>在你的项目 <code>SweetDependency</code> 配置文件中配置存储库。</p><div class="language-yaml line-numbers-mode" data-ext="yml"><pre class="shiki github-dark-dimmed" style="background-color:#22272e;" tabindex="0"><code><span class="line"><span style="color:#8DDB8C;">repositories</span><span style="color:#ADBAC7;">:</span></span>
<span class="line"><span style="color:#ADBAC7;">  </span><span style="color:#8DDB8C;">google</span><span style="color:#ADBAC7;">:</span></span>
<span class="line"><span style="color:#ADBAC7;">  </span><span style="color:#8DDB8C;">maven-central</span><span style="color:#ADBAC7;">:</span></span>
<span class="line"><span style="color:#ADBAC7;">  </span><span style="color:#768390;"># (可选) 你可以添加此 URL 以使用我们的公共存储库</span></span>
<span class="line"><span style="color:#ADBAC7;">  </span><span style="color:#768390;"># 当 Sonatype-OSS 发生故障无法发布依赖时，此存储库作为备选进行添加</span></span>
<span class="line"><span style="color:#ADBAC7;">  </span><span style="color:#768390;"># 详情请前往：https://github.com/HighCapable/maven-repository</span></span>
<span class="line"><span style="color:#ADBAC7;">  </span><span style="color:#8DDB8C;">highcapable-maven-releases</span><span style="color:#ADBAC7;">:</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;"># 中国大陆用户请将下方的 &quot;raw.githubusercontent.com&quot; 修改为 &quot;raw.gitmirror.com&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#8DDB8C;">url</span><span style="color:#ADBAC7;">: </span><span style="color:#96D0FF;">https://raw.githubusercontent.com/HighCapable/maven-repository/main/repository/releases</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="传统方式" tabindex="-1"><a class="header-anchor" href="#传统方式" aria-hidden="true">#</a> 传统方式</h4><p>在你的项目 <code>build.gradle.kts</code> 中配置存储库。</p><div class="language-kotlin line-numbers-mode" data-ext="kt"><pre class="shiki github-dark-dimmed" style="background-color:#22272e;" tabindex="0"><code><span class="line"><span style="color:#DCBDFB;">repositories</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#DCBDFB;">google</span><span style="color:#ADBAC7;">()</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#DCBDFB;">mavenCentral</span><span style="color:#ADBAC7;">()</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// (可选) 你可以添加此 URL 以使用我们的公共存储库</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// 当 Sonatype-OSS 发生故障无法发布依赖时，此存储库作为备选进行添加</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// 详情请前往：https://github.com/HighCapable/maven-repository</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#768390;">// 中国大陆用户请将下方的 &quot;raw.githubusercontent.com&quot; 修改为 &quot;raw.gitmirror.com&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#DCBDFB;">maven</span><span style="color:#ADBAC7;">(</span><span style="color:#96D0FF;">&quot;https://raw.githubusercontent.com/HighCapable/maven-repository/main/repository/releases&quot;</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="配置-java-版本" tabindex="-1"><a class="header-anchor" href="#配置-java-版本" aria-hidden="true">#</a> 配置 Java 版本</h3><p>在你的项目 <code>build.gradle.kts</code> 中修改 Kotlin 的 Java 版本为 17 及以上。</p><blockquote><p>Java 项目</p></blockquote><div class="language-kotlin line-numbers-mode" data-ext="kt"><pre class="shiki github-dark-dimmed" style="background-color:#22272e;" tabindex="0"><code><span class="line"><span style="color:#DCBDFB;">java</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">    sourceCompatibility </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> JavaVersion.VERSION_17</span></span>
<span class="line"><span style="color:#ADBAC7;">    targetCompatibility </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> JavaVersion.VERSION_17</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#DCBDFB;">kotlin</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#DCBDFB;">jvmToolchain</span><span style="color:#ADBAC7;">(</span><span style="color:#6CB6FF;">17</span><span style="color:#ADBAC7;">)</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote><p>Android 项目</p></blockquote><div class="language-kotlin line-numbers-mode" data-ext="kt"><pre class="shiki github-dark-dimmed" style="background-color:#22272e;" tabindex="0"><code><span class="line"><span style="color:#DCBDFB;">android</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#DCBDFB;">compileOptions</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">        sourceCompatibility </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> JavaVersion.VERSION_17</span></span>
<span class="line"><span style="color:#ADBAC7;">        targetCompatibility </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> JavaVersion.VERSION_17</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">    </span><span style="color:#DCBDFB;">kotlinOptions</span><span style="color:#ADBAC7;"> {</span></span>
<span class="line"><span style="color:#ADBAC7;">        jvmTarget </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">&quot;17&quot;</span></span>
<span class="line"><span style="color:#ADBAC7;">    }</span></span>
<span class="line"><span style="color:#ADBAC7;">}</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="功能一览" tabindex="-1"><a class="header-anchor" href="#功能一览" aria-hidden="true">#</a> 功能一览</h2><p>整个项目分为多个模块，你可以选择你希望引入的模块作为依赖应用到你的项目中，但一定要包含 <strong>kavaref-core</strong> 模块。</p><p>你可以点击下方对应的模块前往查看详细的功能介绍。</p>`,15),C=s("h2",{id:"demo",tabindex:"-1"},[s("a",{class:"header-anchor",href:"#demo","aria-hidden":"true"},"#"),n(" Demo")],-1),B={href:"https://github.com/HighCapable/KavaRef/tree/main/samples",target:"_blank",rel:"noopener noreferrer"};function g(_,k){const e=o("ExternalLinkIcon"),l=o("RouterLink");return t(),c("div",null,[u,s("ul",null,[s("li",null,[s("p",null,[n("IntelliJ IDEA (建议从 "),s("a",v,[n("这里"),a(e)]),n(" 获取最新版本)")])]),s("li",null,[s("p",null,[n("Android Studio (建议从 "),s("a",y,[n("这里"),a(e)]),n(" 获取最新版本)")])]),A]),h,m,s("p",null,[n("我们推荐使用 Kotlin DSL 作为 Gradle 构建脚本语言并推荐使用 "),s("a",b,[n("SweetDependency"),a(e)]),n(" 来管理依赖。")]),D,s("ul",null,[s("li",null,[a(l,{to:"/zh-cn/library/kavaref-core.html"},{default:i(()=>[n("kavaref-core")]),_:1})]),s("li",null,[a(l,{to:"/zh-cn/library/kavaref-extension.html"},{default:i(()=>[n("kavaref-extension")]),_:1})])]),C,s("p",null,[n("你可以在 "),s("a",B,[n("这里"),a(e)]),n(" 找到一些示例，查看对应的演示项目来更好地了解这些功能的运作方式，快速地挑选出你需要的功能。")])])}const x=r(d,[["render",g],["__file","quick-start.html.vue"]]);export{x as default};
