diff --git a/CHANGELOG.md b/CHANGELOG.md index 74708df81..4d34af050 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,35 @@ Changelog * 0.10.x: PhpStorm 7 (no support) * 0.9.x: PhpStorm 6 (no support) +## 0.16.166 + + + ## 0.16.165 * Prevent duplicate same targets in yaml targets eg for class navigation * Refactoring bundle loading, replacing HashMaps with ArrayList for non unique bundle project names diff --git a/MAINTENANCE.md b/MAINTENANCE.md new file mode 100644 index 000000000..9a879212c --- /dev/null +++ b/MAINTENANCE.md @@ -0,0 +1,50 @@ +# Maintaining the plugin + +## Forging a new release + +The plugin is released manually, based on a git tag. + +A gradle plugin automatically determines the current tag and / or if this +is a snapshot release. + +To build the plugin, execute the gradle task `buildPlugin`. + +```bash +./gradlew clean buildPlugin +``` + +The artifact zip can then be found in `build/distrubutions`. This is the +final result which can be uploaded to the JetBrains repository. + +The checklist for a new release should be the following: + +* ensure the project is currently on the latest commit on the `master` branch + You can enforce this by pulling and resetting with the `--hard` flag +* make sure there are no staged changes +* prepare the changelog: + * execute `./prepare-release.sh` to write the changelog to disk + * manually copy the relevant parts to `CHANGELOG.md` +* commit the changed files (preferrable with a meaningful commit message + `Prepare release 0.16.xxx`) +* tag a release (`git tag 0.x.xxx`) +* push the changed code and the tag to the remote (`git push && git push --tags`) +* build the plugin on the tag (`./gradlew clean buildPlugin`) + +## Upload to JetBrain Plugin repository + +The plugin can be updated in two different ways. + +### Manual upload + +Upload the produced ZIP file to the JetBrains repository manually + +### Semi-automatic upload through gradle + +The IntelliJ gradle plugin ships a task to upload the release +automatically. This will include the changelog generated earlier. + +Execute the following gradle task: + +```bash +IJ_REPO_USERNAME=youruser IJ_REPO_PASSWORD=yourpassword ./gradlew clean buildPlugin publishPlugin +``` diff --git a/build.gradle b/build.gradle index 47dda8130..fbfbc7243 100644 --- a/build.gradle +++ b/build.gradle @@ -9,9 +9,12 @@ buildscript { } plugins { - id "org.jetbrains.intellij" version "0.3.3" + id "org.jetbrains.intellij" version "0.3.11" + id 'com.palantir.git-version' version "0.11.0" } +def htmlFixer = { htmlFile -> file(htmlFile).text.replace('', '').replace('', '') } + apply plugin: 'idea' apply plugin: 'org.jetbrains.intellij' apply plugin: 'java' @@ -31,14 +34,26 @@ intellij { 'properties' ] pluginName 'Symfony Plugin' +} - patchPluginXml { - sinceBuild '173' - } +patchPluginXml { + sinceBuild '173' + changeNotes = htmlFixer('src/main/resources/META-INF/change-notes.html') +} + +publishPlugin { + username System.getenv('IJ_REPO_USERNAME') + password System.getenv('IJ_REPO_PASSWORD') } group 'fr.adrienbrault.idea.symfony2plugin' -version '0.16.165' + +def details = versionDetails() +if (details.isCleanTag) { + version = "${details.lastTag}" +} else { + version = "${details.lastTag}.${details.gitHash}-SNAPSHOT" +} wrapper { gradleVersion '4.3.1' diff --git a/prepare-release.sh b/prepare-release.sh new file mode 100755 index 000000000..f37a2d2cf --- /dev/null +++ b/prepare-release.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +echo "" >> change-notes.html + +cp change-notes.html src/main/resources/META-INF/ + +rm change-notes.html diff --git a/src/main/resources/META-INF/change-notes.html b/src/main/resources/META-INF/change-notes.html new file mode 100644 index 000000000..90e77b9d0 --- /dev/null +++ b/src/main/resources/META-INF/change-notes.html @@ -0,0 +1,26 @@ +