diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/Main.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/Main.kt index c4b54f26..5ab2e0c4 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/Main.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/Main.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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 org.morfly.airin.sample import org.morfly.airin.sample.generator.ProjectGenerator diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/AndroidDataBindingModuleGenerator.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/AndroidDataBindingModuleGenerator.kt index 634cad03..031c325e 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/AndroidDataBindingModuleGenerator.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/AndroidDataBindingModuleGenerator.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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 org.morfly.airin.sample.generator import org.morfly.airin.starlark.writer.FileWriter diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/ProjectGenerator.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/ProjectGenerator.kt index fbc48c5d..937921b0 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/ProjectGenerator.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/generator/ProjectGenerator.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("SpellCheckingInspection") package org.morfly.airin.sample.generator @@ -42,7 +58,6 @@ class ProjectGenerator { fun generate(numOfModules: Int, disableStrictJavaDeps: Boolean = false, depsOverlap: Int = 0) { require(numOfModules > 0) { "number of data binding modules must be positive." } -// workspaceDir.deleteRecursively() workspaceDir.mkdir() generateToolsBuild() diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_library_build.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_library_build.kt index 9c9cd7bc..ce55eb68 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_library_build.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_library_build.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("LocalVariableName", "FunctionName", "SpellCheckingInspection") package org.morfly.airin.sample.template diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_workspace.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_workspace.kt index a9cd98a2..18e90714 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_workspace.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/android_databinding_workspace.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("LocalVariableName", "FunctionName", "SpellCheckingInspection") package org.morfly.airin.sample.template diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/AndroidManifestTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/AndroidManifestTemplate.kt deleted file mode 100644 index 90047db5..00000000 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/AndroidManifestTemplate.kt +++ /dev/null @@ -1,15 +0,0 @@ -@file:Suppress("FunctionName") - -package org.morfly.airin.sample.template.manifest - - -fun android_manifest_template( - packageName: String - /** - * - */ -) = """ - - -""".trimIndent() \ No newline at end of file diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/android_manifest_template.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/android_manifest_template.kt new file mode 100644 index 00000000..dde2626a --- /dev/null +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/android_manifest_template.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + +@file:Suppress("FunctionName") + +package org.morfly.airin.sample.template.manifest + + +fun android_manifest_template( + packageName: String + /** + * + */ +) = """ + + +""".trimIndent() \ No newline at end of file diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/MainAndroidManifestTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/main_android_manifest_template.kt similarity index 57% rename from examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/MainAndroidManifestTemplate.kt rename to examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/main_android_manifest_template.kt index d2b30671..2734643e 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/MainAndroidManifestTemplate.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/manifest/main_android_manifest_template.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName") package org.morfly.airin.sample.template.manifest diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/other/android_databindind_bazelrc.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/other/android_databindind_bazelrc.kt index b6eb3b84..868a56fe 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/other/android_databindind_bazelrc.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/other/android_databindind_bazelrc.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName", "SpellCheckingInspection") package org.morfly.airin.sample.template.other diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/root_build.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/root_build.kt index baaf3e19..423cef05 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/root_build.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/root_build.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName") package org.morfly.airin.sample.template diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/BindingAdaptersTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/BindingAdaptersTemplate.kt deleted file mode 100644 index 502dd195..00000000 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/BindingAdaptersTemplate.kt +++ /dev/null @@ -1,24 +0,0 @@ -@file:Suppress("FunctionName") - -package org.morfly.airin.sample.template.src - - -fun binding_adapters_template( - packageName: String, - adapterName: String -) = """ -package $packageName; - -import androidx.databinding.BindingAdapter; -import android.widget.TextView; - - -public class BindingAdapters { - - @BindingAdapter("$adapterName") - public static void $adapterName(TextView view, String $adapterName) { - view.setText($adapterName); - } -} - -""".trimIndent() \ No newline at end of file diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/ViewModelTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/ViewModelTemplate.kt deleted file mode 100644 index 54175209..00000000 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/ViewModelTemplate.kt +++ /dev/null @@ -1,23 +0,0 @@ -@file:Suppress("FunctionName") - -package org.morfly.airin.sample.template.src - - -fun view_model_template( - vmPackageName: String, - vmClassName: String, - vmPropertyName: String, - vmPropertyValue: String - /** - * - */ -) = """ -package $vmPackageName - - -class $vmClassName { - - val $vmPropertyName: String - get() = "$vmPropertyValue" -} -""".trimIndent() \ No newline at end of file diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/ActivityTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/activity_template.kt similarity index 59% rename from examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/ActivityTemplate.kt rename to examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/activity_template.kt index 15c46337..2c6823a1 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/ActivityTemplate.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/activity_template.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName") package org.morfly.airin.sample.template.src diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/binding_adapters_template.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/binding_adapters_template.kt new file mode 100644 index 00000000..5bb29c2b --- /dev/null +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/binding_adapters_template.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + +@file:Suppress("FunctionName") + +package org.morfly.airin.sample.template.src + + +fun binding_adapters_template( + packageName: String, + adapterName: String +) = """ +package $packageName; + +import androidx.databinding.BindingAdapter; +import android.widget.TextView; + + +public class BindingAdapters { + + @BindingAdapter("$adapterName") + public static void $adapterName(TextView view, String $adapterName) { + view.setText($adapterName); + } +} + +""".trimIndent() \ No newline at end of file diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/BindingLayoutTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/binding_layout_template.kt similarity index 66% rename from examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/BindingLayoutTemplate.kt rename to examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/binding_layout_template.kt index 6cb16be5..44d72dbe 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/BindingLayoutTemplate.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/binding_layout_template.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName") package org.morfly.airin.sample.template.src diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/RegularFileTemplate.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/regular_file_template.kt similarity index 59% rename from examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/RegularFileTemplate.kt rename to examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/regular_file_template.kt index e4333212..af785b2b 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/RegularFileTemplate.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/regular_file_template.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName") package org.morfly.airin.sample.template.src diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/view_model_template.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/view_model_template.kt new file mode 100644 index 00000000..fc8531f6 --- /dev/null +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/src/view_model_template.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + +@file:Suppress("FunctionName") + +package org.morfly.airin.sample.template.src + + +fun view_model_template( + vmPackageName: String, + vmClassName: String, + vmPropertyName: String, + vmPropertyValue: String + /** + * + */ +) = """ +package $vmPackageName + + +class $vmClassName { + + val $vmPropertyName: String + get() = "$vmPropertyValue" +} +""".trimIndent() \ No newline at end of file diff --git a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/tools_build.kt b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/tools_build.kt index aee585ec..afee8de2 100644 --- a/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/tools_build.kt +++ b/examples/generation/android-databinding/config/src/main/kotlin/org/morfly/airin/sample/template/tools_build.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2021 Pavlo Stavytskyi + * + * 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. + */ + @file:Suppress("FunctionName") package org.morfly.airin.sample.template