Skip to content

Commit

Permalink
Add modeled-java build/config files & main module
Browse files Browse the repository at this point in the history
  • Loading branch information
userzimmermann committed Apr 13, 2024
1 parent 31a4eea commit a0d1f8c
Show file tree
Hide file tree
Showing 7 changed files with 703 additions and 0 deletions.
73 changes: 73 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
plugins {
id 'groovy'
id 'java'
id 'java-library'
id 'maven-publish'

alias libs.plugins.versions
}

wrapper {
gradleVersion = '8.7'
}


group 'me.modeled'
version '0.1.0-SNAPSHOT'

java {
sourceCompatibility = 17
targetCompatibility = 17
}


repositories {
mavenLocal()
mavenCentral()
}

dependencies {
gradleApi()
localGroovy()

api libs.streamex

implementation libs.handlebars
implementation libs.javapoet
implementation libs.throwing.function

annotationProcessor libs.auto.service
implementation libs.auto.service

annotationProcessor libs.lombok
compileOnly libs.lombok
}


import com.github.benmanes.gradle.versions.reporter.PlainTextReporter

dependencyUpdates {
outputFormatter { /** Combining custom with default output was adapted from:
https://github.com/ben-manes/gradle-versions-plugin/issues/566#issuecomment-961929993
*/
new PlainTextReporter(project, revision, gradleReleaseChannel).write System.out, it

final outdated = it.outdated.dependencies.findAll { !(it.name.startsWith 'spock-') }
if (outdated != it.outdated.dependencies) {
println "\nIgnoring outdated Spock dependencies."
}

if (outdated) {
throw new RuntimeException("Outdated dependencies: ${outdated.collect { it.name }}")
}
}
}


publishing {
publications {
maven MavenPublication, {
from components.java
}
}
}
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.log.fieldName = LOG
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'modeled-java'
34 changes: 34 additions & 0 deletions src/main/java/me/modeled/Modeled.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/** MODELED-Java
Copyright 2024 Stefan Zimmermann <[email protected]>
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 me.modeled;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


@Retention(RetentionPolicy.SOURCE) @Target({ElementType.TYPE})
public @interface Modeled {

@Retention(RetentionPolicy.SOURCE) @Target({ElementType.FIELD})
@interface Property {

boolean immutable() default false;
}
}
Loading

0 comments on commit a0d1f8c

Please sign in to comment.