mirror of https://github.com/hyperledger/besu
Use external pantheon-plugin-api library (#1505)
* Use the external jars to provide the plugin libraries. * Add mavenLocal to local repositories to aid development * Remove the :plugins project * Move the PantheonPluginContextImpl into :pantheon * rename a few files Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>pull/2/head
parent
ac9d1e4ca0
commit
16c64e64f0
@ -1,5 +1,5 @@ |
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip |
||||
|
@ -1,58 +0,0 @@ |
||||
/* |
||||
* Copyright 2018 ConsenSys AG. |
||||
* |
||||
* Licensed 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. |
||||
*/ |
||||
|
||||
apply plugin: 'java-library' |
||||
|
||||
jar { |
||||
baseName 'pantheon-plugins' |
||||
manifest { |
||||
attributes( |
||||
'Specification-Title': baseName, |
||||
'Specification-Version': project.version, |
||||
'Implementation-Title': baseName, |
||||
'Implementation-Version': calculateVersion() |
||||
) |
||||
} |
||||
} |
||||
|
||||
dependencies { |
||||
implementation 'com.google.guava:guava' |
||||
implementation 'org.apache.logging.log4j:log4j-api' |
||||
|
||||
testAnnotationProcessor 'com.google.auto.service:auto-service' |
||||
|
||||
testImplementation 'com.google.auto.service:auto-service' |
||||
testImplementation 'info.picocli:picocli' |
||||
testImplementation 'junit:junit' |
||||
testImplementation 'org.apache.logging.log4j:log4j-api' |
||||
testImplementation 'org.assertj:assertj-core' |
||||
testImplementation 'org.mockito:mockito-core' |
||||
} |
||||
|
||||
task testJar(type: Jar) { |
||||
archiveName 'testPlugin.jar' |
||||
manifest { |
||||
attributes( |
||||
'Specification-Title': baseName, |
||||
'Specification-Version': project.version, |
||||
'Implementation-Title': baseName, |
||||
'Implementation-Version': calculateVersion() |
||||
) |
||||
} |
||||
archiveClassifier = 'tests' |
||||
from sourceSets.test.output |
||||
} |
||||
|
||||
configurations { testArtifacts } |
||||
|
||||
artifacts { testArtifacts testJar } |
@ -1,20 +0,0 @@ |
||||
/* |
||||
* Copyright 2019 ConsenSys AG. |
||||
* |
||||
* Licensed 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. |
||||
*/ |
||||
package tech.pegasys.pantheon.plugins; |
||||
|
||||
import java.util.Optional; |
||||
|
||||
public interface PantheonContext { |
||||
|
||||
<T> Optional<T> getService(Class<T> serviceType); |
||||
} |
@ -1,22 +0,0 @@ |
||||
/* |
||||
* Copyright 2019 ConsenSys AG. |
||||
* |
||||
* Licensed 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. |
||||
*/ |
||||
package tech.pegasys.pantheon.plugins; |
||||
|
||||
public interface PantheonPlugin { |
||||
|
||||
void register(PantheonContext context); |
||||
|
||||
void start(); |
||||
|
||||
void stop(); |
||||
} |
@ -1,2 +0,0 @@ |
||||
/** This package will be hidden from external users once Pantheon migrates to Java 11. */ |
||||
package tech.pegasys.pantheon.plugins.internal; |
@ -1,36 +0,0 @@ |
||||
/* |
||||
* Copyright 2019 ConsenSys AG. |
||||
* |
||||
* Licensed 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. |
||||
*/ |
||||
package tech.pegasys.pantheon.plugins.services; |
||||
|
||||
public interface PantheonEvents { |
||||
|
||||
/** |
||||
* Returns the raw RLP of a block that Pantheon has received and that has passed basic validation |
||||
* checks. |
||||
* |
||||
* @param blockJSONListener The listener that will accept a JSON string as the event. |
||||
* @return an object to be used as an identifier when de-registering the event. |
||||
*/ |
||||
Object addNewBlockPropagatedListener(NewBlockPropagatedListener blockJSONListener); |
||||
|
||||
/** |
||||
* Remove the blockAdded listener from pantheon notifications. |
||||
* |
||||
* @param listenerIdentifier The instance that was returned from addBlockAddedListener; |
||||
*/ |
||||
void removeNewBlockPropagatedListener(Object listenerIdentifier); |
||||
|
||||
interface NewBlockPropagatedListener { |
||||
void newBlockPropagated(String jsonBlock); |
||||
} |
||||
} |
@ -1,27 +0,0 @@ |
||||
/* |
||||
* Copyright 2019 ConsenSys AG. |
||||
* |
||||
* Licensed 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. |
||||
*/ |
||||
package tech.pegasys.pantheon.plugins.services; |
||||
|
||||
/** This service will be available during the registration callbacks. */ |
||||
public interface PicoCLIOptions { |
||||
|
||||
/** |
||||
* During the registration callback plugins can register CLI options that should be added to |
||||
* Pantheon's CLI startup. |
||||
* |
||||
* @param namespace A namespace prefix. All registered options must start with this prefix |
||||
* @param optionObject The instance of the object to be inspected. PicoCLI will reflect the fields |
||||
* of this object to extract the CLI options. |
||||
*/ |
||||
void addPicoCLIOptions(String namespace, Object optionObject); |
||||
} |
Loading…
Reference in new issue