mirror of
https://github.com/corda/corda.git
synced 2025-04-06 19:07:08 +00:00
changing substitution mechanism so that it can work with code blocks
This commit is contained in:
parent
78aee24f69
commit
803ea3e652
@ -37,7 +37,7 @@ Step 2. Adjust the version numbers in your Gradle build files
|
||||
|
||||
Alter the versions you depend on in your Gradle file like so:
|
||||
|
||||
.. parsed-literal::
|
||||
.. code:: groovy
|
||||
|
||||
ext.corda_release_version = '|corda_version|'
|
||||
ext.corda_gradle_plugins_version = '|gradle_plugins_version|'
|
||||
|
@ -11,17 +11,23 @@ with open("../../constants.properties", "r") as f:
|
||||
constants_properties_lines = f.readlines()
|
||||
constants_properties_dict = dict([l.strip().split('=') for l in constants_properties_lines if not l.startswith("#") and not l.strip() == ""])
|
||||
|
||||
rst_epilog = """
|
||||
.. |java_version| replace:: 8u%s
|
||||
.. |kotlin_version| replace:: %s
|
||||
.. |gradle_plugins_version| replace:: %s
|
||||
.. |quasar_version| replace:: %s
|
||||
.. |corda_version| replace:: %s
|
||||
""" % (constants_properties_dict["java8MinUpdateVersion"],
|
||||
constants_properties_dict["kotlinVersion"],
|
||||
constants_properties_dict["gradlePluginsVersion"],
|
||||
constants_properties_dict["quasarVersion"],
|
||||
constants_properties_dict["cordaVersion"])
|
||||
def cordaSourceReadReplace(app, docname, source):
|
||||
result = source[0]
|
||||
for key in app.config.corda_substitutions:
|
||||
result = result.replace(key, app.config.corda_substitutions[key])
|
||||
source[0] = result
|
||||
|
||||
corda_substitutions = {
|
||||
"|corda_version|" : constants_properties_dict["cordaVersion"],
|
||||
"|java_version|" : "8u"+constants_properties_dict["java8MinUpdateVersion"],
|
||||
"|kotlin_version|" : constants_properties_dict["kotlinVersion"],
|
||||
"|gradle_plugins_version|" : constants_properties_dict["gradlePluginsVersion"],
|
||||
"|quasar_version|" : constants_properties_dict["quasarVersion"]
|
||||
}
|
||||
|
||||
def setup(app):
|
||||
app.add_config_value('corda_substitutions', {}, True)
|
||||
app.connect('source-read', cordaSourceReadReplace)
|
||||
|
||||
############################################################################
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user