Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
2020.1 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Mar 19, 2020
1 parent 48abc7b commit 943463a
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 14 deletions.
12 changes: 10 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ container:
image: gradle:latest

task:
name: Test
name: Tests
build_script: gradle classes testClasses
test_script: gradle test
test_script: gradle test

task:
name: Publish
only_if: $CIRRUS_TAG != ''
depends_on: Tests
env:
JETBRAINS_TOKEN: ENCRYPTED[260a01be940eee2f33c35c8f069067b73c34244f297088843ad96d21c4062469d3628989d768056a5e42eb4e07f31c6b]
test_script: gradle :thrift:publishPlugin
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ How to build
===============

```bahs
./gradlew :thift:buildPlugin
./gradlew :thrift:buildPlugin
```

How to run locally with new changes
===============

```bahs
./gradlew :thift:runIde
./gradlew :thrift:runIde
```
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.jetbrains.intellij" version "0.4.13"
id "org.jetbrains.intellij" version "0.4.16"
}

version = "${version}.$buildNumber"
Expand Down
11 changes: 8 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
version = 1.0
ideaVersion = LATEST-EAP-SNAPSHOT
ideaVersion = 201.6251-EAP-CANDIDATE-SNAPSHOT
javaVersion = 1.8
javaTargetVersion = 1.8
buildNumber = SNAPSHOT
sources = true
isEAP = false
isEAP = false

org.gradle.daemon=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Dfile.encoding=UTF-8
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
3 changes: 3 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;

/**
Expand All @@ -39,6 +36,12 @@ protected ThriftBuilder() {
super(BuilderCategory.SOURCE_GENERATOR);
}

@NotNull
@Override
public List<String> getCompilableFileExtensions() {
return Collections.singletonList("thrift");
}

@Override
public ExitCode build(CompileContext context,
ModuleChunk chunk,
Expand Down
15 changes: 15 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,18 @@ rootDir.traverse(
include getProjectName(dir)
}
}

ext.isCiServer = System.getenv().containsKey("CIRRUS_CI")
ext.isMasterBranch = System.getenv()["CIRRUS_BRANCH"] == "master"
ext.buildCacheHost = System.getenv().getOrDefault("CIRRUS_HTTP_CACHE_HOST", "localhost:12321")

buildCache {
local {
enabled = !isCiServer
}
remote(HttpBuildCache) {
url = "http://${buildCacheHost}/"
enabled = isCiServer
push = isMasterBranch
}
}
8 changes: 8 additions & 0 deletions thrift/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
jar.archiveName = "plugin.jar"

patchPluginXml {
version = System.getenv().getOrDefault("CIRRUS_TAG", "1.0")
}

publishPlugin {
token = System.getenv().getOrDefault("JETBRAINS_TOKEN", "")
}

sourceSets {
main {
java {
Expand Down
6 changes: 5 additions & 1 deletion thrift/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<description>Support for Thrift language</description>
<change-notes>
<![CDATA[
<p>1.1:</p>
<ul>
<li>Compatibility with IntelliJ 2020.1</li>
</ul>
<p>1.0:</p>
<ul>
<li>Compatibility with IntelliJ 2019.3</li>
Expand Down Expand Up @@ -101,7 +105,7 @@
]]>
</change-notes>
<vendor>@fedor</vendor>
<idea-version since-build="192"/>
<idea-version since-build="192"/><!-- Will be patched by the plugin -->

<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.lang</depends>
Expand Down

0 comments on commit 943463a

Please sign in to comment.