Skip to content

Commit

Permalink
Merge pull request #15 from croz-ltd/feature/polish
Browse files Browse the repository at this point in the history
Polish
  • Loading branch information
Dino Muharemagić authored Jan 10, 2023
2 parents 82be61c + d572bb3 commit ed8db53
Show file tree
Hide file tree
Showing 43 changed files with 842 additions and 725 deletions.
190 changes: 190 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 200
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_visual_guides = none
ij_wrap_on_typing = false

[{*.kt,*.kts}]
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = true
ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_assignment_wrap = normal
ij_kotlin_blank_lines_after_class_header = 0
ij_kotlin_blank_lines_around_block_when_branches = 0
ij_kotlin_blank_lines_before_declaration_with_comment_or_annotation_on_separate_line = 1
ij_kotlin_block_comment_add_space = false
ij_kotlin_block_comment_at_first_column = true
ij_kotlin_call_parameters_new_line_after_left_paren = true
ij_kotlin_call_parameters_right_paren_on_new_line = true
ij_kotlin_call_parameters_wrap = on_every_item
ij_kotlin_catch_on_new_line = false
ij_kotlin_class_annotation_wrap = split_into_lines
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_continuation_indent_for_chained_calls = false
ij_kotlin_continuation_indent_for_expression_bodies = false
ij_kotlin_continuation_indent_in_argument_lists = false
ij_kotlin_continuation_indent_in_elvis = false
ij_kotlin_continuation_indent_in_if_conditions = false
ij_kotlin_continuation_indent_in_parameter_lists = false
ij_kotlin_continuation_indent_in_supertype_lists = false
ij_kotlin_else_on_new_line = false
ij_kotlin_enum_constants_wrap = off
ij_kotlin_extends_list_wrap = normal
ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = true
ij_kotlin_import_nested_classes = false
ij_kotlin_imports_layout = *, java.**, javax.**, kotlin.**, ^
ij_kotlin_insert_whitespaces_in_simple_one_line_method = true
ij_kotlin_keep_blank_lines_before_right_brace = 2
ij_kotlin_keep_blank_lines_in_code = 2
ij_kotlin_keep_blank_lines_in_declarations = 2
ij_kotlin_keep_first_column_comment = true
ij_kotlin_keep_indents_on_empty_lines = false
ij_kotlin_keep_line_breaks = true
ij_kotlin_lbrace_on_next_line = false
ij_kotlin_line_break_after_multiline_when_entry = true
ij_kotlin_line_comment_add_space = false
ij_kotlin_line_comment_add_space_on_reformat = false
ij_kotlin_line_comment_at_first_column = true
ij_kotlin_method_annotation_wrap = split_into_lines
ij_kotlin_method_call_chain_wrap = normal
ij_kotlin_method_parameters_new_line_after_left_paren = true
ij_kotlin_method_parameters_right_paren_on_new_line = true
ij_kotlin_method_parameters_wrap = on_every_item
ij_kotlin_name_count_to_use_star_import = 100
ij_kotlin_name_count_to_use_star_import_for_members = 100
ij_kotlin_packages_to_use_import_on_demand = java.util.*, kotlinx.android.synthetic.**, io.ktor.**
ij_kotlin_parameter_annotation_wrap = off
ij_kotlin_space_after_comma = true
ij_kotlin_space_after_extend_colon = true
ij_kotlin_space_after_type_colon = true
ij_kotlin_space_before_catch_parentheses = true
ij_kotlin_space_before_comma = false
ij_kotlin_space_before_extend_colon = true
ij_kotlin_space_before_for_parentheses = true
ij_kotlin_space_before_if_parentheses = true
ij_kotlin_space_before_lambda_arrow = true
ij_kotlin_space_before_type_colon = false
ij_kotlin_space_before_when_parentheses = true
ij_kotlin_space_before_while_parentheses = true
ij_kotlin_spaces_around_additive_operators = true
ij_kotlin_spaces_around_assignment_operators = true
ij_kotlin_spaces_around_equality_operators = true
ij_kotlin_spaces_around_function_type_arrow = true
ij_kotlin_spaces_around_logical_operators = true
ij_kotlin_spaces_around_multiplicative_operators = true
ij_kotlin_spaces_around_range = false
ij_kotlin_spaces_around_relational_operators = true
ij_kotlin_spaces_around_unary_operator = false
ij_kotlin_spaces_around_when_arrow = true
ij_kotlin_variable_annotation_wrap = off
ij_kotlin_while_on_new_line = false
ij_kotlin_wrap_elvis_expressions = 1
ij_kotlin_wrap_expression_body_functions = 1
ij_kotlin_wrap_first_method_in_call_chain = false

[{*.gant,*.groovy,*.gson,*.gdsl,*.gy,*.gradle}]
ij_groovy_indent_size = 2
ij_groovy_tab_width = 2
ij_groovy_continuation_indent_size = 4
ij_groovy_label_indent_size = 4
ij_groovy_align_multiline_array_initializer_expression = true
ij_groovy_align_multiline_assignment = true
ij_groovy_align_multiline_binary_operation = true
ij_groovy_align_multiline_chained_methods = true
ij_groovy_align_multiline_parameters = false
ij_groovy_align_multiline_parameters_in_calls = true
ij_groovy_align_multiline_ternary_operation = true
ij_groovy_array_initializer_new_line_after_left_brace = true
ij_groovy_array_initializer_right_brace_on_new_line = true
ij_groovy_array_initializer_wrap = normal
ij_groovy_assert_statement_wrap = on_every_item
ij_groovy_assignment_wrap = normal
ij_groovy_binary_operation_wrap = normal
ij_groovy_blank_lines_around_method_in_interface = 0
ij_groovy_block_brace_style = next_line_if_wrapped
ij_groovy_call_parameters_wrap = normal
ij_groovy_call_parameters_new_line_after_left_paren = false
ij_groovy_call_parameters_right_paren_on_new_line = false
ij_groovy_catch_on_new_line = true
ij_groovy_class_brace_style = next_line_if_wrapped
ij_groovy_do_while_brace_force = always
ij_groovy_else_on_new_line = true
ij_groovy_enum_constants_wrap = on_every_item
ij_groovy_extends_keyword_wrap = normal
ij_groovy_finally_on_new_line = true
ij_groovy_for_brace_force = always
ij_groovy_for_statement_wrap = on_every_item
ij_groovy_if_brace_force = always
ij_groovy_imports_layout = *, |, jakarta.**, javax.**, java.**, |, $*
ij_groovy_keep_first_column_comment = true
ij_groovy_keep_multiple_expressions_in_one_line = true
ij_groovy_keep_simple_blocks_in_one_line = true
ij_groovy_lambda_brace_style = next_line_if_wrapped
ij_groovy_method_brace_style = next_line_if_wrapped
ij_groovy_method_call_chain_wrap = on_every_item
ij_groovy_method_parameters_new_line_after_left_paren = true
ij_groovy_method_parameters_wrap = normal
ij_groovy_parentheses_expression_new_line_after_left_paren = true
ij_groovy_parentheses_expression_right_paren_on_new_line = true
ij_groovy_prefer_parameters_wrap = true
ij_groovy_resource_list_new_line_after_left_paren = true
ij_groovy_resource_list_wrap = on_every_item
ij_groovy_space_before_array_initializer_left_brace = true
ij_groovy_spaces_within_gstring_injection_braces = false
ij_groovy_ternary_operation_wrap = on_every_item
ij_groovy_throws_keyword_wrap = normal
ij_groovy_throws_list_wrap = normal
ij_groovy_while_brace_force = always
ij_groovy_while_on_new_line = true

[{*.markdown,*.md}]
ij_markdown_force_one_space_after_blockquote_symbol = true
ij_markdown_force_one_space_after_header_symbol = true
ij_markdown_force_one_space_after_list_bullet = true
ij_markdown_force_one_space_between_words = true
ij_markdown_keep_indents_on_empty_lines = false
ij_markdown_max_lines_around_block_elements = 1
ij_markdown_max_lines_around_header = 1
ij_markdown_max_lines_between_paragraphs = 1
ij_markdown_min_lines_around_block_elements = 1
ij_markdown_min_lines_around_header = 1
ij_markdown_min_lines_between_paragraphs = 1

[*.properties]
ij_properties_align_group_field_declarations = false
ij_properties_keep_blank_lines = true
ij_properties_key_value_delimiter = equals
ij_properties_spaces_around_key_value_delimiter = false

[{*.yaml,*.yml}]
ij_yaml_indent_size = 2
ij_yaml_align_values_properties = do_not_align
ij_yaml_autoinsert_sequence_marker = true
ij_yaml_block_mapping_on_new_line = false
ij_yaml_indent_sequence_value = true
ij_yaml_keep_indents_on_empty_lines = false
ij_yaml_keep_line_breaks = true
ij_yaml_sequence_on_new_line = false
ij_yaml_space_before_colon = false
ij_yaml_spaces_within_braces = false
ij_yaml_spaces_within_brackets = false
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
build-and-deploy-documentation:
strategy:
matrix:
java: [ "17" ]
os: [ ubuntu-latest ]
java: ["11"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - JDK ${{ matrix.java }}
Expand Down Expand Up @@ -93,4 +93,4 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
uses: gradle/gradle-build-action@v2
with:
arguments: :plugin:publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
arguments: :plugin:publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ under the `schemaRegistry` group:
## License

Copyright (c) 2023 CROZ Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
16 changes: 4 additions & 12 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,22 @@ plugins {
alias(libs.plugins.kotlinx.binaryCompatibilityValidator)
}

// Dependencies
dependencies {
implementation(libs.apicurio.client)

testFixturesApi(libs.apicurio.client)
testFixturesImplementation(libs.spock.testContainers)
}

// Compile
java {
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
}

// Test
testing {
suites {
val test by getting(JvmTestSuite::class) {
Expand Down Expand Up @@ -93,7 +90,6 @@ kover {
}
}

// Documentation
tasks.withType<DokkaTask>() {
dokkaSourceSets {
configureEach {
Expand All @@ -102,7 +98,6 @@ tasks.withType<DokkaTask>() {
}
}

// Plugin
gradlePlugin {
plugins {
create("apicurio-registry-gradle-plugin") {
Expand All @@ -116,8 +111,6 @@ gradlePlugin {
testSourceSets(sourceSets.getByName("functionalTest"))
}

// For publishing to the Gradle Plugin Portal
// https://plugins.gradle.org/docs/publish-plugin
pluginBundle {
website = "https://github.com/croz-ltd/apicurio-registry-gradle-plugin"
vcsUrl = "https://github.com/croz-ltd/apicurio-registry-gradle-plugin.git"
Expand All @@ -129,12 +122,11 @@ val isSnapshot = project.version.toString().endsWith("SNAPSHOT")
val isRelease = !isSnapshot

val check = tasks.named("check")
val functionalTest = tasks.named("functionalTest")

tasks.named("publishPlugins") {
onlyIf { isRelease }

if (isRelease) {
dependsOn(check)
}
}
}
4 changes: 4 additions & 0 deletions plugin/dokka/moduledoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This module shows the Apicurio Registry Gradle Plugin syntax usage.

The root package containing the plugin implementation.

# Package net.croz.apicurio.exception

Contains the exceptions used by this plugin.

# Package net.croz.apicurio.extension

Contains the extensions that consist of all the settings and properties for this plugin.
Expand Down
4 changes: 2 additions & 2 deletions plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=1.0.0
VERSION=1.1.0

kotlin.code.style=official
kotlin.code.style=official
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ package net.croz.apicurio
import net.croz.apicurio.core.specification.AbstractFunctionalSpecification

class SchemaRegistryPluginSpecification extends AbstractFunctionalSpecification {
def setup() {
appendPluginDefinition()
}
def setup() {
appendPluginDefinition()
}

def "adds tasks"() {
when:
def "adds tasks"() {
when:
def buildResult = build("tasks")

then:
then:
buildResult.output.contains(
"""
"""
SchemaRegistry tasks
--------------------
schemaRegistryCompatibility - Checks for compatibility issues between local artifacts and remote artifacts on the Apicurio schema registry
schemaRegistryDownload - Downloads artifacts from the Apicurio schema registry
schemaRegistryRegister - Registers artifacts on the Apicurio schema registry
""".stripIndent()
)
}
}
}
Loading

0 comments on commit ed8db53

Please sign in to comment.