Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
7f31b345
Commit
7f31b345
authored
7 years ago
by
Anton Lobov
Browse files
Options
Download
Email Patches
Plain Diff
ant tasks to update json schemas + update more schemas
parent
4b862019
Branches unavailable
Tags unavailable
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
json/src/jsonSchema/build.xml
+90
-0
json/src/jsonSchema/build.xml
with
90 additions
and
0 deletions
+90
-0
json/src/jsonSchema/build.xml
0 → 100644
+
90
-
0
View file @
7f31b345
<?xml version="1.0" encoding="ISO-8859-1"?>
<project
name=
"JSON Schemas Update"
default=
"update_schemas"
>
<property
name=
"idea.project.home"
value=
"${basedir}/../../../../"
/>
<macrodef
name=
"get_schema"
>
<attribute
name=
"fromUrl"
/>
<attribute
name=
"toFile"
/>
<sequential>
<get
src=
"@{fromUrl}"
dest=
"@{toFile}"
/>
<local
name=
"baseUrl"
/>
<property
name=
"baseUrl"
value=
"@{fromUrl}"
/>
<script
language=
"javascript"
>
<![CDATA[
var url = new java.net.URL(project.getProperty("baseUrl"));
var connection = url.openConnection();
var etag = connection.getHeaderField("ETag");
project.setProperty("etag", etag);
]]>
</script>
<echo
message=
"${etag}"
file=
"@{toFile}.ETAG"
/>
</sequential>
</macrodef>
<target
name=
"prettier"
>
<get_schema
fromUrl=
"http://json.schemastore.org/prettierrc-1.8.2"
toFile=
"${idea.project.home}/contrib/prettierJS/resources/prettierrc-schema.json"
/>
<!-- Add schema ID manually -->
<replaceregexp
file=
"${idea.project.home}/contrib/prettierJS/resources/prettierrc-schema.json"
match=
""definitions""
replace=
""id": "http://json.schemastore.org/prettierrc-1.8.2",${line.separator} "definitions""
/>
</target>
<target
name=
"tslint"
>
<get_schema
fromUrl=
"http://json.schemastore.org/tslint"
toFile=
"${idea.project.home}/contrib/tslint/resources/tslintJsonSchema/tslint-schema.json"
/>
</target>
<target
name=
"nodejs"
>
<get_schema
fromUrl=
"http://json.schemastore.org/package"
toFile=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
/>
<!-- add custom properties for eslint, prettier, styleling, jest, jshint, hscs -->
<replaceregexp
file=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
match=
""publishConfig""
replace=
""eslintConfig" : {"$ref": "http://json.schemastore.org/eslintrc#"},${line.separator} "publishConfig""
/>
<replaceregexp
file=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
match=
""publishConfig""
replace=
""prettier" : {"$ref": "http://json.schemastore.org/prettierrc-1.8.2#"},${line.separator} "publishConfig""
/>
<replaceregexp
file=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
match=
""publishConfig""
replace=
""stylelint" : {"$ref": "http://json.schemastore.org/stylelintrc#"},${line.separator} "publishConfig""
/>
<replaceregexp
file=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
match=
""publishConfig""
replace=
""jest" : {"type": "object", "$ref": "https://facebook.github.io/jest/docs/configuration.html#"},${line.separator} "publishConfig""
/>
<replaceregexp
file=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
match=
""publishConfig""
replace=
""jshintConfig" : {"$ref": "http://json.schemastore.org/jshintrc#"},${line.separator} "publishConfig""
/>
<replaceregexp
file=
"${idea.project.home}/plugins/NodeJS/src/com/jetbrains/nodejs/packageJson/packageJsonSchema.json"
match=
""publishConfig""
replace=
""jscsConfig" : {"$ref": "http://json.schemastore.org/jscsrc#"},${line.separator} "publishConfig""
/>
</target>
<target
name=
"js_schemas"
>
<get_schema
fromUrl=
"http://json.schemastore.org/babelrc"
toFile=
"${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/.babelrc-schema.json"
/>
<!-- stylelint schema is buggy - we modified it manually to get better results -->
<!--<get_schema fromUrl="http://json.schemastore.org/stylelintrc"
toFile="${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/.stylelintrc-schema.json" />-->
<get_schema
fromUrl=
"http://json.schemastore.org/jsconfig"
toFile=
"${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/jsconfig-schema.json"
/>
<get_schema
fromUrl=
"http://json.schemastore.org/tsconfig"
toFile=
"${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/tsconfig-schema.json"
/>
<get_schema
fromUrl=
"http://json.schemastore.org/tsd"
toFile=
"${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/tsd-schema.json"
/>
<get_schema
fromUrl=
"http://json.schemastore.org/typings"
toFile=
"${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/typings-schema.json"
/>
<!-- eslintrc schema is buggy - only manual updates -->
<!--<get_schema fromUrl="http://json.schemastore.org/eslintrc"
toFile="${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/.eslintrc-schema.json" />
<replaceregexp file="${idea.project.home}/plugins/JavaScriptLanguage/src/jsonSchemas/.eslintrc-schema.json"
match=""definitions"" replace=""id": "http://json.schemastore.org/eslintrc",${line.separator} "definitions"" />-->
</target>
<target
name=
"ALL"
>
<antcall
target=
"js_schemas"
/>
<antcall
target=
"prettier"
/>
<antcall
target=
"tslint"
/>
<antcall
target=
"nodejs"
/>
</target>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help