Skip to content

Commit

Permalink
Update build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricziel committed Oct 5, 2018
1 parent 73d74a5 commit 83eddd4
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ before_install:
- "export ORG_GRADLE_PROJECT_twigPluginVersion=${TWIG_PLUGIN_VERSION}"

env:
- IDEA_VERSION="IU-2018.2" PHP_PLUGIN_VERSION="182.3684.42" TOOLBOX_PLUGIN_VERSION="0.4.6" TWIG_PLUGIN_VERSION="182.3458.35"
- IDEA_VERSION="IU-183.3283.2" PHP_PLUGIN_VERSION="183.3283.10" TOOLBOX_PLUGIN_VERSION="0.4.6" TWIG_PLUGIN_VERSION="183.3283.10"
- IDEA_VERSION="IU-2018.2.4" PHP_PLUGIN_VERSION="182.4505.42" TOOLBOX_PLUGIN_VERSION="0.4.6" TWIG_PLUGIN_VERSION="182.3341.34"
- IDEA_VERSION="IU-2018.1" PHP_PLUGIN_VERSION="181.4203.565" TOOLBOX_PLUGIN_VERSION="0.4.6" TWIG_PLUGIN_VERSION="181.3741.23"
- IDEA_VERSION="IU-2017.3.5" PHP_PLUGIN_VERSION="173.4301.34" TOOLBOX_PLUGIN_VERSION="0.4.6" TWIG_PLUGIN_VERSION="173.4301.7"

script:
- "./gradlew check buildPlugin"
- "./gradlew check verifyPlugin buildPlugin"
50 changes: 50 additions & 0 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
@@ -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
```
21 changes: 16 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ buildscript {
}

plugins {
id "org.jetbrains.intellij" version "0.2.18"
id "org.jetbrains.intellij" version "0.3.11"
id 'com.palantir.git-version' version "0.11.0"
}

def htmlFixer = { htmlFile -> file(htmlFile).text.replace('<html>', '').replace('</html>', '') }

apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'

intellij {
version ideaVersion
updateSinceUntilBuild false
plugins = [
"com.jetbrains.php:${phpPluginVersion}",
"de.espend.idea.php.toolbox:${toolboxPluginVersion}",
Expand All @@ -27,14 +31,21 @@ intellij {
'properties'
]
pluginName 'PHP Annotations'
}

patchPluginXml {
sinceBuild '173'
}
patchPluginXml {
changeNotes = htmlFixer('src/main/resources/META-INF/change-notes.html')
sinceBuild '173'
}

group 'de.espend.idea.php.annotation'
version '5.3'

def details = versionDetails()
if (details.isCleanTag) {
version = "${details.lastTag}"
} else {
version = "${details.lastTag}.${details.gitHash}-SNAPSHOT"
}

wrapper {
gradleVersion '4.3.1'
Expand Down
11 changes: 8 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
ideaVersion = IU-2018.2
phpPluginVersion = 182.3684.42
twigPluginVersion = 182.3458.35
#ideaVersion = IU-183.3283.2
#phpPluginVersion = 183.3283.10
#twigPluginVersion = 183.3283.10
#toolboxPluginVersion = 0.4.6

ideaVersion = IU-2018.2.4
phpPluginVersion = 182.4505.42
twigPluginVersion = 182.3341.34
toolboxPluginVersion = 0.4.6

#ideaVersion = IU-2018.1
Expand Down
8 changes: 8 additions & 0 deletions prepare-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
echo "<html><ul>" > change-notes.html
git log `git describe --tags --abbrev=0`..HEAD --no-merges --oneline --pretty=format:"<li>%h %s (%an)</li>" >> change-notes.html
echo "</ul></html>" >> change-notes.html

cp change-notes.html src/main/resources/META-INF/

rm change-notes.html
9 changes: 9 additions & 0 deletions src/main/resources/META-INF/change-notes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html><ul>
<li>443f8c6 Create a description for DoctrineOrmRepositoryIntention (Cedric Ziel)</li>
<li>a520820 Do not bind doc tags to variables (Cedric Ziel)</li>
<li>765f56c Remove until constraint and update php plugin to 182.3684.42 (Cedric Ziel)</li>
<li>4fe34f7 Add 2018.2 platform to the build environment (Cedric Ziel)</li>
<li>8e73e00 Don't strip starting backslashes from FQN (Cedric Ziel)</li>
<li>97ef114 Use ORM alias for embedded classes (Konstantin Myakshin)</li>
<li>fcb020e Allow @Attributes and @Attribute annotations for @Annotation classes (#111) (meyerbaptiste)</li>
<li>c858ef4 Convert project structure to use a gradle build (#110) (Cedric Ziel)</li></ul></html>

0 comments on commit 83eddd4

Please sign in to comment.