Skip to content

Commit

Permalink
Merge pull request #44 from pbroadbery/release-precheck
Browse files Browse the repository at this point in the history
Various cleanups
  • Loading branch information
pbroadbery authored Apr 2, 2021
2 parents 98b1692 + b25a36d commit eb243ae
Show file tree
Hide file tree
Showing 46 changed files with 532 additions and 182 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,39 @@ jobs:

- name: Check tag
run: |
set -x
RELEASE=false
if [[ $GITHUB_REF =~ ^refs/tags/release-.*$ ]];
then
RELEASE=true
fi
echo "RELEASE is $RELEASE"
echo "RELEASE=$RELEASE" >> $GITHUB_ENV
- name: Create mini-script
run: echo "wrapper {gradleVersion='5.2.1'}" > nada.gradle
run: echo "wrapper {gradleVersion='5.6.4'}" > nada.gradle

- name: Create Wrapper
run: gradle -b nada.gradle wrapper

- name: Check version
run: ./gradlew --version

- name: Build
run: ./gradlew assemble -Daldor.plugin.release=${{ env.RELEASE }}

- name: Test
run: ./gradlew check -Daldor.build.skip_ci=true --continue
run: |
./gradlew check -Daldor.build.skip_ci=true --continue
- name: Publish Test Results
if: ${{ always() }}
uses: mikepenz/action-junit-report@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/test-results/test/TEST-*.xml'

- name: Publish build artifact
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: plugin
path: build/distributions/*.zip
Expand Down
55 changes: 44 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ buildscript {

plugins {
id 'java'
id 'org.jetbrains.intellij' version '0.4.22' apply false
id "de.undercouch.download" version "3.2.0" apply false
id "org.jetbrains.grammarkit" version "2020.3.2" apply false
id 'idea'
id "org.jetbrains.intellij" version "0.6.3"
id "de.undercouch.download" version "3.2.0"
id "org.jetbrains.grammarkit" version "2020.3.1"
}

wrapper {
Expand All @@ -41,6 +42,8 @@ def libLocation = new File(libSource).exists() ? libSource : "extjars"
group 'pab.aldor'
version isRelease ? baseVersion : "${baseVersion}-SNAPSHOT"

println "VERSION IS ${baseVersion} Release: ${isRelease}"

tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
tasks.withType(Test) {
testLogging.showStandardStreams = true
Expand All @@ -52,15 +55,20 @@ java {
sourceCompatibility = JavaVersion.VERSION_11
}

apply plugin: 'org.jetbrains.intellij'
apply plugin: 'org.jetbrains.grammarkit'
apply plugin: 'de.undercouch.download'

intellij {
// version "IC-202.8194.7" //version '2020.2.4'
version "IC-201.7223.91" //version '2019.2'
//version "IC-202.8194.7" //version '2020.2.4'
//version "IC-201.7223.91" //version '2019.2'
//version "202.8194.7" // 2020.3
plugins = ['java']
downloadSources = true
type = 'IC'
pluginName = "${pluginName}"
version = "${platformVersion}"
updateSinceUntilBuild = true
}

buildSearchableOptions {
enabled = false
}

allprojects {
Expand Down Expand Up @@ -95,15 +103,21 @@ allprojects {
grammarKit {
// version of IntelliJ patched JFlex (see bintray link below), Default is 1.7.0-1
jflexRelease = '1.7.0-1'
grammarKitRelease = '2020.1'
}

dependencies {
compile project('jps-plugin')
testCompile group: 'junit', name: 'junit', version: '4.13.2'
compile files(libFiles.collect({"lib/${it}.jar"}))

compile group: 'org.jetbrains.intellij.deps', name: 'asm-all', version: '8.0.1'
}

patchPluginXml {
sinceBuild("${pluginSinceBuild}")
untilBuild("${pluginUntilBuild}")

changeNotes """
Add change notes here.<br>
<em>most HTML tags may be used</em>"""
Expand Down Expand Up @@ -155,7 +169,6 @@ task generateLexer(type: GenerateLexer) {
}

task generateLexer1(type: JavaExec) {
String dstRoot = "$project.projectDir/src/gen/jflex"
String pkg = 'aldor/lexer'
String src = "$project.projectDir/src/main/jflex/${pkg}/aldor.flex"
String dst = "src/gen/jflex/" + pkg
Expand Down Expand Up @@ -188,11 +201,23 @@ task updateExternalJars(type: Copy) {
it.exclude()
}
}
doLast {
println("updated external library files from " + libLocation)
}
}

task list(dependsOn: configurations.compile) {
doLast {
println "classpath = ${configurations.compile.collect { File file -> file.toString()}}"
println "classpath = ${configurations.runtime.collect { File file -> file.toString() }}"
}
}


task listCompileOnly(dependsOn: configurations.compile) {
doLast {
for (f in project.configurations.compileOnly.files) {
println "compileOnly "+ f
}
}
}

Expand Down Expand Up @@ -242,6 +267,7 @@ def parserTask(project, parserName, pkg) {
pathToParser = "${pkg}/${parserName}Parser.java"
pathToPsiRoot = "${pkg}/psi"
purgeOldFiles = true
def extra = 'fastutil'
}
def cleaner = tasks.create("clean${parserName}Parser") {
outputs.upToDateWhen { false }
Expand All @@ -250,6 +276,7 @@ def parserTask(project, parserName, pkg) {
for (f in tt.outputs.getFiles()) { f.delete() }
}
}

tasks.clean.dependsOn cleaner
return tt
}
Expand All @@ -261,3 +288,9 @@ test {
}
maxHeapSize = "6g"
}

idea {
module {
downloadSources = true
}
}
Binary file modified extjars/SpadType.jar
Binary file not shown.
10 changes: 9 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
baseVersion=1.2
baseVersion=1.3

pluginSinceBuild = 202
pluginUntilBuild = 203.*
platformVersion = 2020.2.4

# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
pluginVerifierIdeVersions = 2020.2.4, 2020.3.2, 2021.1
2 changes: 1 addition & 1 deletion jps-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jar {

apply plugin: 'org.jetbrains.intellij'
intellij {
version "IC-201.7223.91"
version = platformVersion
plugins = ['java'] // Probably shouldn't be needed, but is
configureDefaultDependencies = false
}
Expand Down
32 changes: 25 additions & 7 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>pab.aldor</id>
<name>AldorAndSpad</name>
<version>1.1</version>
<vendor email="p.broadbery@gmail.com" url="http://www.notreally.org">Peter Broadbery</vendor>
<vendor email="p.broadbery@gmail.com" url="http://www.github.com/pbroadbery">Peter Broadbery</vendor>

<description><![CDATA[
Aldor/Spad plugin - Provides editing facilities for Aldor and SPAD programs.
Expand All @@ -13,12 +13,12 @@
This version provides more features
- running SPAD and .input files
- full edit support
- limited suport for SPAD type hierarchies
- limited support for SPAD type hierarchies
]]>
</change-notes>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<idea-version since-build="201"/>
<idea-version since-build="201.6668.114" until-build="203.*"/>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products -->
Expand All @@ -42,6 +42,21 @@
</project-components>

<extensions defaultExtensionNs="com.intellij">
<fileType name="Aldor"
implementationClass="aldor.file.AldorFileType"
fieldName="INSTANCE"
extensions="as" language="Aldor"/>
<fileType name="Spad"
implementationClass="aldor.file.SpadFileType"
fieldName="INSTANCE"
extensions="spad" language="Spad"
/>
<fileType name="Input"
implementationClass="aldor.file.SpadInputFileType"
fieldName="INSTANCE"
extensions="input"
language="Spad"/>

<!-- Common-->
<projectService serviceInterface="aldor.build.AldorCompilationService"
serviceImplementation="aldor.build.AldorCompilationServiceImpl"/>
Expand Down Expand Up @@ -88,11 +103,11 @@
<!-- Aldor extras -->
<lang.refactoringSupport language="Aldor" implementationClass="aldor.references.AldorRefactoringSupportProvider"/>
<documentationProvider implementation="aldor.editor.documentation.AldorDocumentationProvider"/>
<fileTypeFactory implementation="aldor.file.AldorFileTypeFactory"/>

<lang.parserDefinition language="Aldor" implementationClass="aldor.parser.AldorParserDefinition"/>

<facetType implementation="aldor.build.facet.aldor.AldorFacetType"/>
<library.type implementation="aldor.library.AldorLibraryType"/>
<!-- <library.type implementation="aldor.library.AldorLibraryType"/> -->
<sdkType implementation="aldor.sdk.aldor.AldorInstalledSdkType"/>
<sdkType implementation="aldor.sdk.aldor.AldorLocalSdkType"/>

Expand All @@ -107,7 +122,7 @@

<!-- Spad extras -->
<facetType implementation="aldor.build.facet.fricas.FricasFacetType"/>
<fileTypeFactory implementation="aldor.file.SpadFileTypeFactory"/>
<!--<fileTypeFactory implementation="aldor.file.SpadFileTypeFactory"/> deprecated -->
<lang.parserDefinition language="Spad" implementationClass="aldor.parser.SpadParserDefinition"/>
<stubIndex implementation="aldor.psi.index.AbbrevNameIndex"/>
<stubIndex implementation="aldor.psi.index.AbbrevAbbrevIndex"/>
Expand All @@ -122,7 +137,10 @@


<!-- Test language -->
<fileTypeFactory implementation="aldor.expression.ExpressionFileTypeFactory"/>
<!-- <fileTypeFactory implementation="aldor.expression.ExpressionFileTypeFactory"/> deprecated -->
<fileType name="Expression"
implementationClass="aldor.expression.ExpressionFileType"
extensions="expr" language="Expression"/>
<lang.parserDefinition language="Expression" implementationClass="aldor.expression.ExpressionParserDefinition"/>
<stubElementTypeHolder class="aldor.expression.ExpressionTypes"/>
<stubIndex implementation="aldor.expression.ExpressionDefineStubIndex"/>
Expand Down
11 changes: 8 additions & 3 deletions src/main/grammar/Aldor.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,20 @@
implements("WithPart") = 'aldor.psi.AldorWith'
implements("UnaryWithExpr") = 'aldor.psi.AldorWith'
implements("BinaryWithExpr") = 'aldor.psi.AldorWith'

stubClass("UnaryWith")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("WithPart")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("UnaryWithExpr")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
stubClass("BinaryWithExpr")='com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>'
mixin("UnaryWithExpr") ="com.intellij.extapi.psi.StubBasedPsiElementBase<com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>>"
mixin("BinaryWithExpr") ="com.intellij.extapi.psi.StubBasedPsiElementBase<com.intellij.psi.stubs.EmptyStub<aldor.psi.AldorWith>>"

mixin("UnaryWith")="aldor.psi.impl.AldorWithMixin"
mixin("WithPart")="aldor.psi.impl.AldorWithMixin"
mixin("UnaryWithExpr")="aldor.psi.impl.AldorWithMixin"
mixin("BinaryWithExpr")="aldor.psi.impl.AldorWithMixin"

// add
stubClass("UnaryAdd")='com.intellij.psi.stubs.EmptyStub<com.intellij.psi.PsiElement>'
//stubClass("UnaryAdd")='com.intellij.psi.stubs.EmptyStub<com.intellij.psi.PsiElement>'
//implements("UnaryAdd")='aldor.psi.AldorAdd'

// Declarations (should be with body only...)
// Version 2, I think.
Expand Down
1 change: 0 additions & 1 deletion src/main/grammar/Expression.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@

stubClass("DefineStmt")='aldor.expression.ExpressionDefineStub'
implements("DefineStmt")='aldor.expression.psi.ExpressionDefine'

}

Goal ::= StatementSequence
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/aldor/build/facet/fricas/FricasFacet.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public static FricasFacet createFacetIfMissing(Module module, FricasFacetPropert
return prev;
}
FricasFacet facet = facetManager.createFacet(ft, FricasFacetType.FRICAS_FACET_NAME, null);
facet.getConfiguration().loadState(properties);
ModifiableFacetModel facetModel = facetManager.createModifiableModel();
facetModel.addFacet(facet);
facetModel.commit();
facet.getConfiguration().loadState(properties);
FacetManager.getInstance(module).facetConfigurationChanged(facet);
return facet;

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/aldor/build/module/AldorModuleBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ protected ProjectType getProjectType() {
return ALDOR_PROJECT_TYPE;
}

@Override
protected boolean isAvailable() {
return false;
}

@Override
public void setupRootModel(final ModifiableRootModel rootModel) throws ConfigurationException {
doAddContentEntry(rootModel);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/aldor/expression/ExpressionDefineMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package aldor.expression;

public interface ExpressionDefineMixin {
}
3 changes: 2 additions & 1 deletion src/main/java/aldor/file/AldorFileType.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package aldor.file;

import aldor.language.AldorLanguage;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.LanguageFileType;
import icons.AldorIcons;
import org.jetbrains.annotations.NotNull;
Expand All @@ -11,7 +12,7 @@

public final class AldorFileType extends LanguageFileType {
@SuppressWarnings("TypeMayBeWeakened")
public static final AldorFileType INSTANCE = new AldorFileType();
public static final FileType INSTANCE = new AldorFileType();

private AldorFileType() {
super(AldorLanguage.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.google.common.collect.Sets;
import com.intellij.ide.hierarchy.HierarchyNodeDescriptor;
import com.intellij.ide.hierarchy.HierarchyTreeStructure;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.SmartPointerManager;
Expand All @@ -26,6 +27,7 @@
import static aldor.syntax.SyntaxUtils.psiElementFromSyntax;

public final class AldorParentCategoryHierarchyTreeStructure extends HierarchyTreeStructure {
private static final Logger LOG = Logger.getInstance(AldorParentCategoryHierarchyTreeStructure.class);
private static final Set<Class<?>> leafElements = Sets.newHashSet(AldorHierarchyOperationDescriptor.class, ErrorNodeDescriptor.class);
private static final Object[] EMPTY_ARRAY = new Object[0];
private final SmartPsiElementPointer<PsiElement> smartPointer;
Expand Down Expand Up @@ -93,7 +95,9 @@ protected Object[] buildChildren(@NotNull HierarchyNodeDescriptor descriptor) {
}
Syntax syntax = aldorDescriptor.syntax();
List<Syntax> parents = Try.of(() -> library.parentCategories(syntax)).orElse(e -> Collections.emptyList());
List<SpadLibrary.Operation> operations = Try.of(() -> library.operations(syntax)).orElse(e -> Collections.emptyList());
List<SpadLibrary.Operation> operations = Try.of(() -> library.operations(syntax))
.peekError(t -> LOG.error("Failed to convert operations from " + syntax, t))
.orElse(e -> Collections.emptyList());

Stream<Object> parentNodes = parents.stream().map(psyntax -> createNodeDescriptorMaybe(aldorDescriptor, psyntax));
Stream<Object> operationNodes = operations.stream().map(op -> createOperationNodeDescriptorMaybe(aldorDescriptor, op));
Expand Down
Loading

0 comments on commit eb243ae

Please sign in to comment.