Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertispan v0.2 #1

Open
wants to merge 49 commits into
base: rebased_main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ca8621a
Update ci.yml
cushon May 8, 2022
76350a5
Update ASM version
cushon May 11, 2022
fea3d70
Handle `sealed` psuedo-modifier on nested classes
cushon May 31, 2022
0257dd9
Automatic code cleanup.
kluever Jun 15, 2022
e065f06
Use `InputStream#readAllBytes` instead of `ByteStreams#toByteArray`
cushon Aug 15, 2022
7a57fe6
Update string representation of annotated types
cushon Aug 19, 2022
90afe95
Use `JarEntry#setTimeLocal`
cushon Aug 30, 2022
677a625
Fix a CCE
cushon Sep 6, 2022
c8e7422
Add support for native-image builds for turbine to maven build
cushon Sep 7, 2022
00b2396
Update ci.yml
cushon Oct 6, 2022
2d45238
Update ci.yml
cushon Oct 24, 2022
1dfdf24
Default to `SourceVersion.latestSupported()` if an unrecognized sourc…
cushon Oct 25, 2022
0ae59e2
Update Error Prone version
cushon Oct 25, 2022
a63f34e
Improve implementation of `asMemberOf`
cushon Nov 9, 2022
1404eb6
turbine: attach javadoc to enum members
java-team-github-bot Nov 30, 2022
df7c0da
Update ASM API level
cushon Dec 16, 2022
ef7604d
Remove workaround for b/188833569 - AutoValue is supposed to add `@Nu…
cushon Dec 27, 2022
d564b9d
Automatic code cleanup.
kluever Dec 27, 2022
8b280f3
Fix a bug with javadoc comments followed by unicode escapes
cushon Jan 5, 2023
e6d6f3c
Don't emit duplicate `toString`, `equals`, and `hashCode` methods in …
cushon Jan 12, 2023
f356af6
Delete dependabot.yml
cushon Jan 15, 2023
f1dd955
Fix handling of implicit record constructors
cushon Jan 19, 2023
f3a8d2e
Don't crash on duplicate type parameter declarations
cushon Jan 23, 2023
56af181
Check interface and non-interface types in `extends` and `implements`…
cushon Jan 23, 2023
6f69bf9
Update ci.yml
cushon Feb 27, 2023
4d6f6da
Use `java.util.function.Function` instead of `com.google.common.base.…
eamonnmcmanus Apr 7, 2023
5467d7b
Handle synthetic method parameters entries that don't have names
cushon May 8, 2023
e965ed4
Ensure that source jars are closed after being read.
eamonnmcmanus May 17, 2023
af4ad30
Add support for source jars to `OverlayCompiler`.
eamonnmcmanus May 17, 2023
866696b
Add a debug option to enable emitting private fields
cushon May 31, 2023
0a910b8
Prepare for stricter nullness stub for `Files.createDirectories`.
cpovirk Jun 2, 2023
046233d
Write `package-info`s even if the package info doesn't contain any an…
cushon Jun 26, 2023
98ab952
Only emit package-info's if the source file's path is 'package-info.j…
cushon Jul 4, 2023
4465877
Update Guava version
cushon Jul 27, 2023
0eb9d98
Update ci.yml
cushon Aug 6, 2023
f3ba5a0
Update ASM version
cushon Aug 7, 2023
237ce44
Update native-maven-plugin to 0.9.23
fmeum Sep 6, 2023
7509b92
Create release.yml
cushon Sep 8, 2023
312da26
Update release.yml
cushon Sep 8, 2023
c606948
Update dependency versions
cushon Sep 9, 2023
6d7838f
Add test case for annotation processor option with space
guw Sep 11, 2023
99ea3e4
Add info about which signing keys will be used for published artifacts
cushon Sep 11, 2023
2e55216
Fix class reading on inner class attributes containing local classes
cushon Sep 16, 2023
8ead671
Use turbine's own class file parser in a test
cushon Sep 16, 2023
d1c43cd
Rename a test that wasn't being run
cushon Sep 19, 2023
7c94356
Update ci.yml for JDK 21 release
cushon Sep 21, 2023
4dd0302
Release turbine 0.2
cushon Sep 22, 2023
6e3d1ae
Mark for a release, push to our own snapshot server
niloc132 Apr 14, 2022
468bec9
version v0.2
treblereel Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
java: [ 17, 11 ]
java: [ 21, 17, 11 ]
experimental: [ false ]
include:
# Only test on macos and windows with a single recent JDK to avoid a
# combinatorial explosion of test configurations.
- os: macos-latest
java: 17
java: 21
experimental: false
- os: windows-latest
java: 17
java: 21
experimental: false
- os: ubuntu-latest
java: 18-ea
java: 22-ea
experimental: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release turbine

on:
workflow_dispatch:
inputs:
version:
description: "version number for this release."
required: true

jobs:
build-maven-jars:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/[email protected]

- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 11
distribution: 'zulu'
cache: 'maven'
server-id: sonatype-nexus-staging
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Bump Version Number
run: |
mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}"
git ls-files | grep 'pom.xml$' | xargs git add
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git commit -m "Release turbine ${{ github.event.inputs.version }}"
git tag "v${{ github.event.inputs.version }}"
echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/turbine.git

- name: Deploy to Sonatype staging
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run:
mvn --no-transfer-progress -P sonatype-oss-release clean deploy -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}"

- name: Push tag
run: |
git push origin "v${{ github.event.inputs.version }}"

- name: Add Jars to Release Entry
uses: softprops/[email protected]
with:
draft: true
name: ${{ github.event.input.version }}
tag_name: "v${{ github.event.inputs.version }}"
target_commitish: ${{ env.TARGET_COMMITISH }}
files: |
target/turbine-*.jar
65 changes: 65 additions & 0 deletions KEYS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
This file contains the PGP and GPG keys used to sign releases.

gpg --list-sigs <your name> && gpg --armor --export <your name>

************************************************************************************************************

pub rsa4096 2022-01-28 [SC]
EE0CA873074092F806F59B65D364ABAA39A47320
uid [ultimate] Liam Miller-Cushon (Error Prone releases) <[email protected]>
sig 3 D364ABAA39A47320 2022-01-28 Liam Miller-Cushon (Error Prone releases) <[email protected]>
sub rsa4096 2022-01-28 [E]
sig D364ABAA39A47320 2022-01-28 Liam Miller-Cushon (Error Prone releases) <[email protected]>

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGH0NlsBEACnLJ3vl/aV+4ytkJ6QSfDFHrwzSo1eEXyuFZ85mLijvgGuaKRr
c9/lKed0MuyhLJ7YD752kcFCEIyPbjeqEFsBcgU/RWa1AEfaay4eMLBzLSOwCvhD
m+1zSFswH2bOqeLSbFZPQ9sVIOzO6AInaOTOoecHChHnUztAhRIOIUYmhABJGiu5
jCP5SStoXm8YtRWT1unJcduHQ51EztQe02k+RTratQ31OSkeJORle7k7cudCS+yp
z5gTaS1Bx02v0Y8Qaw17vY9Pn8DmsECRvXL6K7ItX6zKkSdJYVGMtiF/kp4rg94I
XodrlzrMGPGPga9fTcqMPvx/3ffwgIsgtgaKg7te++L3db/xx48XgZ2qYAU8GssE
N14xRFQmr8sg+QiCIHL0Az88v9mILYOqgxa3RvQ79tTqAKwPg0o2w/wF/WU0Rw53
mdNy9JTUjetWKuoTmDaXVZO4LQ2g4W2dQTbg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RPFQYMVhRRxL5iO
GL/Di7KfAhdbSlKXnC/FVXE0F8YUfl+SmuSly5Ven0HpJFUzzm5ShkkVogXKgCFT
25BB9V7q6DA/0FuHNHMOkl722I5xprPDM2c/lmPfWchXpSW1m7uZVKXUnAhxbFbd
vfqnge30bmMg9BzzFL6gx3/+nyvixgUHgo5hqzW6RE2IKyGf20l96iGQqP17DHJQ
1/WtLy45Qm9kLdzddEXwIldGnGYe7ak81/RDEVWGCEtjZwlTU5YaLo3Jk3rkR1+a
RNt4PF2VI2/z1JMPhWnoyYW2sDglkNJHQGnXMQ8qJLGOkbkWl9W/qVeYVuhrmqRc
Acb35txpFihe6f7AneKhaj5xAR3L9uxfTf4wcyyazyWKSZ88gZXDvdEXcdeMnwZW
pOSpujhmmBPD/tnf58BgT+/Gq6GemXYe8Q==
=BIwO
-----END PGP PUBLIC KEY BLOCK-----
2 changes: 1 addition & 1 deletion java/com/google/turbine/binder/ClassPathBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.turbine.binder;

import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableMap;
Expand All @@ -36,6 +35,7 @@
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.function.Function;
import org.jspecify.nullness.Nullable;

/** Sets up an environment for symbols on the classpath. */
Expand Down
16 changes: 15 additions & 1 deletion java/com/google/turbine/binder/CompUnitPreprocessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import com.google.turbine.tree.Tree.PkgDecl;
import com.google.turbine.tree.Tree.TyDecl;
import com.google.turbine.tree.TurbineModifier;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -105,7 +107,7 @@ public static PreprocessedCompUnit preprocess(CompUnit unit) {
// "While the file could technically contain the source code
// for one or more package-private (default-access) classes,
// it would be very bad form." -- JLS 7.4.1
if (!unit.pkg().get().annos().isEmpty()) {
if (isPackageInfo(unit)) {
decls = Iterables.concat(decls, ImmutableList.of(packageInfoTree(unit.pkg().get())));
}
} else {
Expand All @@ -124,6 +126,18 @@ public static PreprocessedCompUnit preprocess(CompUnit unit) {
unit.imports(), types.build(), unit.mod(), unit.source(), packageName);
}

private static boolean isPackageInfo(CompUnit unit) {
String path = unit.source().path();
if (path == null) {
return false;
}
Path fileName = Paths.get(path).getFileName();
if (fileName == null) {
return false;
}
return fileName.toString().equals("package-info.java");
}

private static ImmutableMap<String, ClassSymbol> preprocessChildren(
SourceFile source,
ImmutableList.Builder<SourceBoundClass> types,
Expand Down
5 changes: 2 additions & 3 deletions java/com/google/turbine/binder/FileManagerClassBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.common.base.Joiner;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableMap;
import com.google.common.io.ByteStreams;
import com.google.turbine.binder.bound.ModuleInfo;
import com.google.turbine.binder.bytecode.BytecodeBoundClass;
import com.google.turbine.binder.env.Env;
Expand Down Expand Up @@ -113,7 +112,7 @@ private ImmutableMap<ClassSymbol, BytecodeBoundClass> listPackage(
@Override
public byte[] get() {
try {
return ByteStreams.toByteArray(jfo.openInputStream());
return jfo.openInputStream().readAllBytes();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down Expand Up @@ -162,7 +161,7 @@ private Map<ClassSymbol, BytecodeBoundClass> getPackage(
@Override
public byte[] get() {
try {
return ByteStreams.toByteArray(fileObject.openInputStream());
return fileObject.openInputStream().readAllBytes();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down
11 changes: 8 additions & 3 deletions java/com/google/turbine/binder/HierarchyBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.turbine.tree.Tree;
import com.google.turbine.tree.Tree.ClassTy;
import java.util.ArrayDeque;
import java.util.LinkedHashMap;
import org.jspecify.nullness.Nullable;

/** Type hierarchy binding. */
Expand Down Expand Up @@ -109,13 +110,17 @@ private SourceHeaderBoundClass bind() {
}
}

ImmutableMap.Builder<String, TyVarSymbol> typeParameters = ImmutableMap.builder();
LinkedHashMap<String, TyVarSymbol> typeParameters = new LinkedHashMap<>();
for (Tree.TyParam p : decl.typarams()) {
typeParameters.put(p.name().value(), new TyVarSymbol(origin, p.name().value()));
TyVarSymbol existing =
typeParameters.putIfAbsent(p.name().value(), new TyVarSymbol(origin, p.name().value()));
if (existing != null) {
log.error(p.position(), ErrorKind.DUPLICATE_DECLARATION, p.name());
}
}

return new SourceHeaderBoundClass(
base, superclass, interfaces.build(), typeParameters.buildOrThrow());
base, superclass, interfaces.build(), ImmutableMap.copyOf(typeParameters));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion java/com/google/turbine/binder/Processing.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static java.util.Objects.requireNonNull;

import com.google.auto.value.AutoValue;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import com.google.common.base.Supplier;
Expand Down Expand Up @@ -66,6 +65,7 @@
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Pattern;
import javax.annotation.processing.Processor;
import javax.lang.model.SourceVersion;
Expand Down
Loading