From 5bc1ff004268496cce4ab2abaeaa1a03ee2926f5 Mon Sep 17 00:00:00 2001 From: tangcent Date: Sun, 19 Nov 2023 22:14:06 +0800 Subject: [PATCH] release 2.2.8 --- IDEA_CHANGELOG.md | 8 +++ gradle.properties | 2 +- idea-plugin/parts/pluginChanges.html | 31 +++------ .../api/export/http/HttpClientExporter.kt | 2 +- .../suv/http/HttpClientProviderTest.kt | 64 +++++++++---------- plugin-script/release.sh | 18 +++++- 6 files changed, 65 insertions(+), 60 deletions(-) diff --git a/IDEA_CHANGELOG.md b/IDEA_CHANGELOG.md index 52cd3ade..9270ff54 100644 --- a/IDEA_CHANGELOG.md +++ b/IDEA_CHANGELOG.md @@ -1,3 +1,11 @@ +* 2.2.8 + + * feat: Add support for exporting APIs as .http files [(#522)](https://github.com/tangcent/easy-api/pull/522) + + * feat: support search in several dialogs [(#521)](https://github.com/tangcent/easy-api/pull/521) + + * Refactor: Preventing runtime.channel() from throwing exceptions on missing implementations [(#520)](https://github.com/tangcent/easy-api/pull/520) + * 2.2.7 * feat: Improve Layout and Responsiveness of Several UI Forms [#518](https://github.com/tangcent/easy-api/pull/#518) diff --git a/gradle.properties b/gradle.properties index b83f8842..38946bce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ plugin_name=EasyApi -plugin_version=2.2.7.212.0 +plugin_version=2.2.8.212.0 kotlin.code.style=official kotlin_version=1.8.0 junit_version=5.9.2 diff --git a/idea-plugin/parts/pluginChanges.html b/idea-plugin/parts/pluginChanges.html index adb8a1d6..4f83458e 100644 --- a/idea-plugin/parts/pluginChanges.html +++ b/idea-plugin/parts/pluginChanges.html @@ -1,29 +1,14 @@ -v2.2.7(2023-11-12)
+v2.2.8(2023-11-19)
Full Changelog - - + \ No newline at end of file diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/http/HttpClientExporter.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/http/HttpClientExporter.kt index 6b00ad09..951bdbb1 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/http/HttpClientExporter.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/http/HttpClientExporter.kt @@ -62,7 +62,7 @@ class HttpClientExporter { val moduleFolderRequestMap = mutableMapOf, MutableList>() for (request in requests) { - val module = moduleHelper.findModule(request.resource!!) ?: "easy-yapi" + val module = moduleHelper.findModule(request.resource!!) ?: "easy-api" val folder = formatFolderHelper.resolveFolder(request.resource!!).name ?: "apis" val key = Pair(module, folder) val requestList = moduleFolderRequestMap.getOrPut(key) { mutableListOf() } diff --git a/idea-plugin/src/test/kotlin/com/itangcent/suv/http/HttpClientProviderTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/suv/http/HttpClientProviderTest.kt index 3494442b..4076c54f 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/suv/http/HttpClientProviderTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/suv/http/HttpClientProviderTest.kt @@ -155,82 +155,82 @@ internal abstract class HttpClientProviderTest : AdvancedContextTest() { val httpClient = httpClientProvider.getHttpClient() //GET - httpClient.get().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.get().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("GET", it.method()) } - httpClient.get("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.get("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("GET", it.method()) } //POST - httpClient.post().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.post().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("POST", it.method()) } - httpClient.post("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.post("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("POST", it.method()) } //PUT - httpClient.put().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.put().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("PUT", it.method()) } - httpClient.put("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.put("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("PUT", it.method()) } //DELETE - httpClient.delete().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.delete().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("DELETE", it.method()) } - httpClient.delete("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.delete("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("DELETE", it.method()) } //OPTIONS - httpClient.options().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.options().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("OPTIONS", it.method()) } - httpClient.options("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.options("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("OPTIONS", it.method()) } //TRACE - httpClient.trace().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.trace().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("TRACE", it.method()) } - httpClient.trace("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.trace("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("TRACE", it.method()) } //PATCH - httpClient.patch().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.patch().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("PATCH", it.method()) } - httpClient.patch("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.patch("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("PATCH", it.method()) } //HEAD - httpClient.head().url("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.head().url("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("HEAD", it.method()) } - httpClient.head("https://github.com/tangcent/easy-yapi/pulls").let { - assertEquals("https://github.com/tangcent/easy-yapi/pulls", it.url()) + httpClient.head("https://github.com/tangcent/easy-api/pulls").let { + assertEquals("https://github.com/tangcent/easy-api/pulls", it.url()) assertEquals("HEAD", it.method()) } diff --git a/plugin-script/release.sh b/plugin-script/release.sh index 883b2838..6f1535ce 100755 --- a/plugin-script/release.sh +++ b/plugin-script/release.sh @@ -11,7 +11,16 @@ echo "Last version: ${last_version}" release_date=$(date +"%Y-%m-%d") # Calculate the next version -next_version=$(echo ${last_version} | awk -F. '{split($0,a,".");a[3]++;printf("%d.%d.%d",a[1],a[2],a[3])}') +parts=(${last_version//./ }) + +if [[ ${parts[2]//[!0-9]/} == 9 ]]; then + parts[2]=0 + parts[1]=$((parts[1] + 1)) +else + parts[2]=$((parts[2] + 1)) +fi + +next_version="${parts[0]}.${parts[1]}.${parts[2]}" echo "Next version: ${next_version}" # Create a new release branch based on the next version @@ -32,6 +41,9 @@ others=$(echo "${commits}" | grep -ivE "^feat|^fix" | sed 's/^/
  • /;s/$/<\/li>/ # Update the version number in the gradle.properties file sed -i.bak "s/version=${last_version}/version=${next_version}/g" ${basedir}/gradle.properties && rm ${basedir}/gradle.properties.bak +# Update the version number in the plugin.xml +sed -i.bak "s/${last_version}/${next_version}/" ${basedir}/idea-plugin/src/main/resources/META-INF/plugin.xml && rm ${basedir}/idea-plugin/src/main/resources/META-INF/plugin.xml.bak + # Write the header to the pluginChanges.html file echo "v${next_version}(${release_date})" > ${basedir}/idea-plugin/parts/pluginChanges.html echo "
    " >> ${basedir}/idea-plugin/parts/pluginChanges.html @@ -56,14 +68,14 @@ fi tidy -q -indent -wrap 0 --show-body-only yes ${basedir}/idea-plugin/parts/pluginChanges.html > ${basedir}/idea-plugin/parts/pluginChanges_temp.html mv ${basedir}/idea-plugin/parts/pluginChanges_temp.html ${basedir}/idea-plugin/parts/pluginChanges.html -commits_for_changes_log=$(git log --pretty=format:"%s" v${last_version}..HEAD | sed -e 's/^\(.*\)(\(#[0-9]*\))$/\ * \1 \[\2\]\(https:\/\/github.com\/tangcent\/easy-api\/pull\/\2\)\n/') +commits_for_changes_log=$(git log --pretty=format:"%s" v${last_version}..HEAD | sed -e 's/^\(.*\)(#\([0-9]*\))$/\ * \1 \[\(#\2\)]\(https:\/\/github.com\/tangcent\/easy-api\/pull\/\2\)\n/') echo "commits_for_changes_log:${commits_for_changes_log}" echo "${commits_for_changes_log}" | cat - ${basedir}/IDEA_CHANGELOG.md > tmp && mv tmp ${basedir}/IDEA_CHANGELOG.md echo "* ${next_version}" | cat - ${basedir}/IDEA_CHANGELOG.md > tmp && mv tmp ${basedir}/IDEA_CHANGELOG.md # Add all changes and create a new commit -git add ${basedir}/gradle.properties ${basedir}/IDEA_CHANGELOG.md ${basedir}/idea-plugin/parts/pluginChanges.html +git add ${basedir}/gradle.properties ${basedir}/IDEA_CHANGELOG.md ${basedir}/idea-plugin/parts/pluginChanges.html ${basedir}/idea-plugin/src/main/resources/META-INF/plugin.xml # Create a new commit with the list of commit messages commit_message="release ${next_version}"