feat: Using dependency walking to verify JDK9 Plugin works (#1065)

* using dependency walking to check JDK9 works

* rollback constant extract

* code format and header format

* improve code

* fix code

* add CI action

* apply for all JDK9 package module

* update ci

* Using plugin rather than code

Signed-off-by: Andy.Chen <iRoiocam@gmail.com>

---------

Signed-off-by: Andy.Chen <iRoiocam@gmail.com>
This commit is contained in:
AndyChen 2024-01-30 14:33:30 +08:00 committed by GitHub
parent abad72d869
commit 8a759bad21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 4 deletions

View file

@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Jdk9.CompileJdk9
import io.github.roiocam.DependWalkerPlugin.autoImport.walkTasks
import io.github.roiocam.TaskDefine._
import io.github.roiocam._
import sbt.Keys._
import sbt._
object PekkoDependWalker {
lazy val jdk9CompileCheckSetting = Seq(
walkTasks := Seq(
WalkTask(
ScopeKeyMatcher((Compile / packageBin).scopedKey, CheckBoth),
ScopeKeyMatcher((CompileJdk9 / compile).scopedKey, CheckConfig))))
}

View file

@ -29,6 +29,7 @@ addSbtPlugin("com.github.pjfanning" % "sbt-source-dist" % "0.1.11")
addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.3.2")
addSbtPlugin("com.github.reibitto" % "sbt-welcome" % "0.4.0")
addSbtPlugin("com.github.sbt" % "sbt-license-report" % "1.6.1")
addSbtPlugin("io.github.roiocam" % "sbt-depend-walker" % "0.1.1")
// We have to deliberately use older versions of sbt-paradox because current Pekko sbt build
// only loads on JDK 1.8 so we need to bring in older versions of parboiled which support JDK 1.8