Skip to content

Commit

Permalink
DEV2-2533: Download and install enterprise plugin (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
Assaf Sapir authored Apr 20, 2023
1 parent 1bdb009 commit 7a0bd09
Show file tree
Hide file tree
Showing 260 changed files with 1,671 additions and 995 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
- name: Get Version
id: get_build_version
run: |
CURRENT_VERSION=$(./gradlew -q currentVersion)
CURRENT_VERSION=$(./gradlew -q :Tabnine:currentVersion)
TIMESTAMP=$(date '+%Y%m%d%H%M%S')
echo "::set-output name=build_version::$CURRENT_VERSION-alpha.$TIMESTAMP"
- name: Publish
run: |
./gradlew publishPlugin -PexternalVersion=${{ steps.get_build_version.outputs.build_version }} -Pchannel=alpha
./gradlew :Tabnine:publishPlugin -PexternalVersion=${{ steps.get_build_version.outputs.build_version }} -Pchannel=alpha
env:
HUB_TOKEN: ${{ secrets.HUB_TOKEN }}
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,14 @@ jobs:
mkdir latest && tar -xvf latest.tar.gz -C latest --strip-components 1
ls -al latest
- name: Build the plugin
- name: Build the plugins
run: ./gradlew buildPlugin

- name: Validate the plugin
run: ./gradlew runPluginVerifier -PlocalPaths="$(pwd)/latest"
- name: Validate the public plugin
run: ./gradlew :Tabnine:runPluginVerifier -PlocalPaths="$(pwd)/latest"

- name: Validate the self-hosted plugin
run: ./gradlew :TabnineSelfHosted:runPluginVerifier -PlocalPaths="$(pwd)/latest"

format:
name: Format Check
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/compatibility-eap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build the plugin
- name: Build the plugins
run: ./gradlew buildPlugin

- name: Download latest EAP
Expand All @@ -31,8 +31,11 @@ jobs:
mkdir latest-eap && tar -xvf latest-eap.tar.gz -C latest-eap --strip-components 1
ls -al latest-eap
- name: Validate the plugin against latest EAP
run: ./gradlew runPluginVerifier -PideVersions="" -PlocalPaths="$(pwd)/latest-eap"
- name: Validate the public plugin against latest EAP
run: ./gradlew :Tabnine:runPluginVerifier -PideVersions="" -PlocalPaths="$(pwd)/latest-eap"

- name: Validate the self-hosted plugin against latest EAP
run: ./gradlew :TabnineSelfHosted:runPluginVerifier -PideVersions="" -PlocalPaths="$(pwd)/latest-eap"

- name: Notify slack fail
if: failure()
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/production-new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Set version
run: |
set -e
OLD_VERSION="$(./gradlew -q currentVersion)"
OLD_VERSION="$(./gradlew -q :Tabnine:currentVersion)"
NEW_VERSION="${{ github.event.inputs.version }}"
if [ -z "$NEW_VERSION" ]; then
NEW_VERSION=$(echo $OLD_VERSION | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g' )
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Get Version
id: get_build_version
run: |
VERSION="$(./gradlew -q currentVersion)"
VERSION="$(./gradlew -q :Tabnine:currentVersion)"
echo "new version is $VERSION"
echo "build_version=$VERSION" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -99,13 +99,13 @@ jobs:

- name: Publish production plugin
run: |
./gradlew publishPlugin -PexternalVersion=${{ needs.set-version.outputs.build_version }} -Pchannel=production
./gradlew :Tabnine:publishPlugin -PexternalVersion=${{ needs.set-version.outputs.build_version }} -Pchannel=production
env:
HUB_TOKEN: ${{ secrets.HUB_TOKEN }}

- name: Get Plugin Path
id: get_plugin_path
run: echo "plugin_path=$(ls -t build/distributions/TabNine-*.zip | head -1)" >> $GITHUB_OUTPUT
run: echo "plugin_path=$(ls -t Tabnine/build/distributions/TabNine-*.zip | head -1)" >> $GITHUB_OUTPUT

- name: Create Release
id: create_release
Expand Down Expand Up @@ -149,12 +149,12 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Build the plugin
run: ./gradlew buildPlugin -PexternalVersion=${{ needs.set-version.outputs.build_version }} -Pchannel=self_hosted
- name: Build the self-hosted plugin
run: ./gradlew :TabnineSelfHosted:buildPlugin -PexternalVersion=${{ needs.set-version.outputs.build_version }} -Pchannel=self_hosted

- name: Get Plugin Path
id: get_plugin_path
run: echo "plugin_path=$(ls -t build/distributions/TabNine-*.zip | head -1)" >> $GITHUB_OUTPUT
run: echo "plugin_path=$(ls -t TabnineSelfHosted/build/distributions/TabNine*.zip | head -1)" >> $GITHUB_OUTPUT

- name: Set stable version file
run: |
Expand Down
74 changes: 74 additions & 0 deletions Common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id 'java'
id "org.jetbrains.kotlin.jvm" version "1.4.32"
id 'org.jetbrains.intellij' version '1.2.0'
id 'org.jlleitschuh.gradle.ktlint' version "10.0.0"
id 'org.jlleitschuh.gradle.ktlint-idea' version "10.0.0"
id "com.github.sherter.google-java-format" version "0.9"
}

repositories {
mavenCentral()
}

group 'com.tabnineCommon'
version project.hasProperty('externalVersion') ? project.externalVersion : '1.0.6'

sourceCompatibility = 9
targetCompatibility = 9

tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "9"
}
}

repositories {
mavenCentral()
}

apply plugin: "org.jlleitschuh.gradle.ktlint-idea"

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32")
implementation 'org.jetbrains:annotations:24.0.0'

testImplementation "org.hamcrest:hamcrest:2.2"
testImplementation 'org.mockito:mockito-core:4.8.0'
testImplementation 'org.mockito:mockito-inline:4.8.0'
testImplementation 'org.mockito:mockito-junit-jupiter:4.8.0'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.35.0'
testImplementation "io.mockk:mockk:1.11.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.9.0'
}

test {
useJUnitPlatform()
reports {
junitXml.enabled = true
}
}

intellij {
version = '2019.3'
type = 'IC'
updateSinceUntilBuild = false
}

def channelName = project.hasProperty('channel') ? project.channel : 'alpha'

sourceSets {
main {
java.srcDirs += "channels/${channelName}"
}
}

tasks {
compileKotlin {
dependsOn(ktlintFormat)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tabnine.config;
package com.tabnineCommon.config;

public class Config {
public static final String CHANNEL = "alpha";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tabnine.config;
package com.tabnineCommon.config;

public class Config {
public static final String CHANNEL = "beta";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tabnine.config;
package com.tabnineCommon.config;

public class Config {
public static final String CHANNEL = "production";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tabnine.config;
package com.tabnineCommon.config;

public class Config {
public static final String CHANNEL = "self_hosted";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tabnine;
package com.tabnineCommon;

import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.vfs.VirtualFile;
import com.tabnine.general.StaticConfig;
import com.tabnineCommon.general.StaticConfig;
import javax.swing.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tabnine;
package com.tabnineCommon;

import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.vfs.VirtualFile;
import com.tabnine.general.StaticConfig;
import com.tabnineCommon.general.StaticConfig;
import javax.swing.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.tabnine;
package com.tabnineCommon;

import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.vfs.VirtualFile;
import com.tabnine.general.StaticConfig;
import com.tabnineCommon.general.StaticConfig;
import javax.swing.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.tabnine
package com.tabnineCommon

import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginStateListener
import com.intellij.openapi.diagnostic.Logger
import com.tabnine.binary.BinaryRequestFacade
import com.tabnine.binary.requests.uninstall.UninstallRequest
import com.tabnine.general.StaticConfig
import com.tabnine.lifecycle.UninstallReporter
import com.tabnineCommon.binary.BinaryRequestFacade
import com.tabnineCommon.binary.requests.uninstall.UninstallRequest
import com.tabnineCommon.general.StaticConfig
import com.tabnineCommon.lifecycle.UninstallReporter
import kotlin.collections.any
import kotlin.jvm.javaClass
import kotlin.let

// An ugly workaround to distinguish between update and uninstall -->
// The uninstall flow contains this method in the call stack.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.tabnine.balloon;
package com.tabnineCommon.balloon;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.tabnine.selections.CompletionListener;
import com.tabnine.selections.CompletionObserver;
import com.tabnine.state.UserState;
import com.tabnineCommon.selections.CompletionListener;
import com.tabnineCommon.selections.CompletionObserver;
import com.tabnineCommon.state.UserState;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.jetbrains.annotations.TestOnly;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.tabnine.balloon;
package com.tabnineCommon.balloon;

import static com.tabnine.general.DependencyContainer.instanceOfBinaryRequestFacade;
import static com.tabnine.general.StaticConfig.ICON;
import static com.tabnine.general.Utils.wrapWithHtml;
import static com.tabnine.general.Utils.wrapWithHtmlTag;
import static com.tabnineCommon.general.DependencyContainer.instanceOfBinaryRequestFacade;
import static com.tabnineCommon.general.StaticConfig.ICON;
import static com.tabnineCommon.general.Utils.wrapWithHtml;
import static com.tabnineCommon.general.Utils.wrapWithHtmlTag;

import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
Expand All @@ -16,8 +16,8 @@
import com.intellij.ui.JBColor;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.util.ui.JBUI;
import com.tabnine.binary.BinaryRequestFacade;
import com.tabnine.binary.requests.notifications.shown.HintShownRequest;
import com.tabnineCommon.binary.BinaryRequestFacade;
import com.tabnineCommon.binary.requests.notifications.shown.HintShownRequest;
import javax.swing.*;
import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tabnine.balloon;
package com.tabnineCommon.balloon;

public interface GotItTooltipAction {
void onGotItClicked();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.tabnine.binary
package com.tabnineCommon.binary

import com.intellij.util.net.HttpConfigurable
import com.intellij.util.proxy.CommonProxy
import com.tabnine.binary.exceptions.TabNineDeadException
import com.tabnine.general.StaticConfig
import com.tabnine.userSettings.AppSettingsState.Companion.instance
import com.tabnineCommon.binary.exceptions.TabNineDeadException
import com.tabnineCommon.general.StaticConfig
import com.tabnineCommon.userSettings.AppSettingsState.Companion.instance
import java.io.BufferedReader
import java.io.IOException
import java.io.InputStreamReader
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

public class BinaryProcessGatewayProvider {
public BinaryProcessGateway generateBinaryProcessGateway() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

import com.tabnine.binary.exceptions.TabNineDeadException;
import com.tabnineCommon.binary.exceptions.TabNineDeadException;
import org.jetbrains.annotations.Nullable;

public interface BinaryProcessRequester {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

import static com.tabnine.general.StaticConfig.ILLEGAL_RESPONSE_THRESHOLD;
import static com.tabnine.general.StaticConfig.wrapWithBinaryRequest;
import static com.tabnineCommon.general.StaticConfig.ILLEGAL_RESPONSE_THRESHOLD;
import static com.tabnineCommon.general.StaticConfig.wrapWithBinaryRequest;

import com.intellij.openapi.diagnostic.Logger;
import com.tabnine.binary.exceptions.TabNineDeadException;
import com.tabnine.binary.exceptions.TabNineInvalidResponseException;
import com.tabnineCommon.binary.exceptions.TabNineDeadException;
import com.tabnineCommon.binary.exceptions.TabNineInvalidResponseException;
import java.io.IOException;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

import static com.tabnine.general.StaticConfig.*;
import static com.tabnine.general.Utils.executeThread;
import static com.tabnineCommon.general.StaticConfig.*;
import static com.tabnineCommon.general.Utils.executeThread;

import com.google.gson.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.ObjectUtils;
import com.tabnine.binary.exceptions.BinaryRequestTimeoutException;
import com.tabnineCommon.binary.exceptions.BinaryRequestTimeoutException;
import java.util.Collections;
import java.util.concurrent.Future;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

import com.tabnine.binary.exceptions.TabNineInvalidResponseException;
import com.tabnineCommon.binary.exceptions.TabNineInvalidResponseException;
import org.jetbrains.annotations.NotNull;

public interface BinaryRequest<R extends BinaryResponse> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

import static com.tabnine.general.StaticConfig.COMPLETION_TIME_THRESHOLD;
import static com.tabnineCommon.general.StaticConfig.COMPLETION_TIME_THRESHOLD;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.concurrency.AppExecutorUtil;
import com.tabnine.binary.exceptions.TabNineDeadException;
import com.tabnineCommon.binary.exceptions.TabNineDeadException;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.tabnine.binary;
package com.tabnineCommon.binary;

public interface BinaryResponse {}
Loading

0 comments on commit 7a0bd09

Please sign in to comment.