Skip to content

Commit

Permalink
Move java specific logic into the new java package.
Browse files Browse the repository at this point in the history
This keeps the main `qsync` package more language agnostic, and keeps language support better encapulated.

PiperOrigin-RevId: 588763291
  • Loading branch information
Googler authored and copybara-github committed Dec 7, 2023
1 parent 3e35774 commit f992f52
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 22 deletions.
4 changes: 2 additions & 2 deletions base/src/com/google/idea/blaze/base/qsync/ProjectLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
import com.google.idea.blaze.qsync.BlazeProject;
import com.google.idea.blaze.qsync.BlazeProjectSnapshotBuilder;
import com.google.idea.blaze.qsync.BlazeProjectSnapshotBuilder.ProjectProtoTransform;
import com.google.idea.blaze.qsync.PackageStatementParser;
import com.google.idea.blaze.qsync.ParallelPackageReader;
import com.google.idea.blaze.qsync.ProjectRefresher;
import com.google.idea.blaze.qsync.VcsStateDiffer;
import com.google.idea.blaze.qsync.java.PackageStatementParser;
import com.google.idea.blaze.qsync.java.ParallelPackageReader;
import com.google.idea.blaze.qsync.project.ProjectDefinition;
import com.google.idea.blaze.qsync.project.ProjectPath;
import com.intellij.openapi.project.Project;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
import com.google.idea.blaze.common.Label;
import com.google.idea.blaze.common.PrintOutput;
import com.google.idea.blaze.exception.BuildException;
import com.google.idea.blaze.qsync.GeneratedSourceProjectUpdater;
import com.google.idea.blaze.qsync.GeneratedSourceProjectUpdater.GeneratedSourceJar;
import com.google.idea.blaze.qsync.SrcJarProjectUpdater;
import com.google.idea.blaze.qsync.TestSourceGlobMatcher;
import com.google.idea.blaze.qsync.cc.CcDependenciesInfo;
import com.google.idea.blaze.qsync.java.GeneratedSourceProjectUpdater;
import com.google.idea.blaze.qsync.java.GeneratedSourceProjectUpdater.GeneratedSourceJar;
import com.google.idea.blaze.qsync.java.JavaArtifactInfo;
import com.google.idea.blaze.qsync.java.JavaTargetInfo.JavaArtifacts;
import com.google.idea.blaze.qsync.java.JavaTargetInfo.JavaTargetArtifacts;
import com.google.idea.blaze.qsync.java.SrcJarProjectUpdater;
import com.google.idea.blaze.qsync.project.BuildGraphData;
import com.google.idea.blaze.qsync.project.ProjectDefinition;
import com.google.idea.blaze.qsync.project.ProjectPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import com.google.auto.value.AutoValue;
import com.google.idea.blaze.base.qsync.cache.FileCache.OutputArtifactDestinationAndLayout;
import com.google.idea.blaze.qsync.PackageStatementParser;
import com.google.idea.blaze.qsync.java.PackageStatementParser;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.nio.file.Files;
Expand Down
1 change: 1 addition & 0 deletions querysync/java/com/google/idea/blaze/qsync/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ java_library(
"//querysync:__subpackages__",
],
deps = [
"//querysync/java/com/google/idea/blaze/qsync/java",
"//querysync/java/com/google/idea/blaze/qsync/project",
"//querysync/java/com/google/idea/blaze/qsync/project:language_class_java_proto",
"//querysync/java/com/google/idea/blaze/qsync/project:project_java_proto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.idea.blaze.common.Context;
import com.google.idea.blaze.exception.BuildException;
import com.google.idea.blaze.qsync.java.PackageReader;
import com.google.idea.blaze.qsync.java.WorkspaceResolvingPackageReader;
import com.google.idea.blaze.qsync.project.BlazeProjectSnapshot;
import com.google.idea.blaze.qsync.project.BuildGraphData;
import com.google.idea.blaze.qsync.project.PostQuerySyncData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.google.idea.blaze.common.PrintOutput;
import com.google.idea.blaze.common.RuleKinds;
import com.google.idea.blaze.exception.BuildException;
import com.google.idea.blaze.qsync.java.PackageReader;
import com.google.idea.blaze.qsync.project.BlazeProjectDataStorage;
import com.google.idea.blaze.qsync.project.BuildGraphData;
import com.google.idea.blaze.qsync.project.LanguageClassProto.LanguageClass;
Expand Down
2 changes: 2 additions & 0 deletions querysync/java/com/google/idea/blaze/qsync/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ java_library(
srcs = glob(["*.java"]),
deps = [
":java_target_info_java_proto",
"//querysync/java/com/google/idea/blaze/qsync/project",
"//querysync/java/com/google/idea/blaze/qsync/project:project_java_proto",
"//shared",
"//third_party/auto_value",
"@com_google_guava_guava//jar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import static com.google.idea.blaze.qsync.SrcJarInnerPathFinder.AllowPackagePrefixes.ALLOW_NON_EMPTY_PACKAGE_PREFIXES;
import static com.google.idea.blaze.qsync.java.SrcJarInnerPathFinder.AllowPackagePrefixes.ALLOW_NON_EMPTY_PACKAGE_PREFIXES;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.qsync.SrcJarInnerPathFinder.JarPath;
import com.google.idea.blaze.qsync.java.SrcJarInnerPathFinder.JarPath;
import com.google.idea.blaze.qsync.project.ProjectPath;
import com.google.idea.blaze.qsync.project.ProjectProto;
import com.google.idea.blaze.qsync.project.ProjectProto.Project;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import java.io.IOException;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import static java.nio.charset.StandardCharsets.UTF_8;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.idea.blaze.qsync.SrcJarInnerPathFinder.AllowPackagePrefixes.EMPTY_PACKAGE_PREFIXES_ONLY;
import static com.google.idea.blaze.qsync.java.SrcJarInnerPathFinder.AllowPackagePrefixes.EMPTY_PACKAGE_PREFIXES_ONLY;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.qsync;
package com.google.idea.blaze.qsync.java;

import static com.google.common.collect.ImmutableList.toImmutableList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.idea.blaze.qsync.SrcJarProjectUpdater;
import com.google.idea.blaze.qsync.java.SrcJarProjectUpdater;
import com.google.idea.blaze.qsync.project.ProjectPath;
import com.google.idea.blaze.qsync.project.ProjectPath.Root;
import com.google.idea.blaze.qsync.project.ProjectProto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import com.google.idea.blaze.exception.BuildException;
import com.google.idea.blaze.qsync.BlazeQueryParser;
import com.google.idea.blaze.qsync.GraphToProjectConverter;
import com.google.idea.blaze.qsync.PackageReader;
import com.google.idea.blaze.qsync.PackageStatementParser;
import com.google.idea.blaze.qsync.ParallelPackageReader;
import com.google.idea.blaze.qsync.WorkspaceResolvingPackageReader;
import com.google.idea.blaze.qsync.java.PackageReader;
import com.google.idea.blaze.qsync.java.PackageStatementParser;
import com.google.idea.blaze.qsync.java.ParallelPackageReader;
import com.google.idea.blaze.qsync.java.WorkspaceResolvingPackageReader;
import com.google.idea.blaze.qsync.project.BuildGraphData;
import com.google.idea.blaze.qsync.project.PostQuerySyncData;
import com.google.idea.blaze.qsync.project.SnapshotDeserializer;
Expand Down
1 change: 1 addition & 0 deletions querysync/javatests/com/google/idea/blaze/qsync/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ java_library(
],
deps = [
"//querysync/java/com/google/idea/blaze/qsync",
"//querysync/java/com/google/idea/blaze/qsync/java",
"//querysync/java/com/google/idea/blaze/qsync/project",
"//querysync/java/com/google/idea/blaze/qsync/project:project_java_proto",
"//querysync/java/com/google/idea/blaze/qsync/query",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import static com.google.idea.blaze.qsync.QuerySyncTestUtils.createSrcJar;

import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.qsync.GeneratedSourceProjectUpdater.GeneratedSourceJar;
import com.google.idea.blaze.qsync.java.GeneratedSourceProjectUpdater;
import com.google.idea.blaze.qsync.java.GeneratedSourceProjectUpdater.GeneratedSourceJar;
import com.google.idea.blaze.qsync.QuerySyncTestUtils.PathPackage;
import com.google.idea.blaze.qsync.project.ProjectPath;
import com.google.idea.blaze.qsync.project.ProjectPath.Resolver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.auto.value.AutoValue;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.qsync.java.PackageReader;
import com.google.idea.blaze.qsync.project.ProjectDefinition;
import com.google.idea.blaze.qsync.project.QuerySyncLanguage;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static com.google.common.truth.Truth.assertThat;

import com.google.common.base.Joiner;
import com.google.idea.blaze.qsync.java.PackageStatementParser;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.common.Context;
import com.google.idea.blaze.common.vcs.VcsState;
import com.google.idea.blaze.qsync.java.PackageReader;
import com.google.idea.blaze.qsync.query.QuerySummary;
import com.google.idea.blaze.qsync.testdata.TestData;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import com.google.common.collect.ImmutableList;
import com.google.idea.blaze.qsync.QuerySyncTestUtils.PathPackage;
import com.google.idea.blaze.qsync.java.SrcJarProjectUpdater;
import com.google.idea.blaze.qsync.project.ProjectPath;
import com.google.idea.blaze.qsync.project.ProjectPath.Resolver;
import com.google.idea.blaze.qsync.project.ProjectProto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.common.Context;
import com.google.idea.blaze.exception.BuildException;
import com.google.idea.blaze.qsync.java.PackageReader;
import com.google.idea.blaze.qsync.project.BlazeProjectSnapshot;
import com.google.idea.blaze.qsync.project.BuildGraphData;
import com.google.idea.blaze.qsync.project.PostQuerySyncData;
Expand Down

0 comments on commit f992f52

Please sign in to comment.