Skip to content

Commit a0d1f8c

Browse files
Add modeled-java build/config files & main module
1 parent 31a4eea commit a0d1f8c

File tree

7 files changed

+703
-0
lines changed

7 files changed

+703
-0
lines changed

build.gradle

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
plugins {
2+
id 'groovy'
3+
id 'java'
4+
id 'java-library'
5+
id 'maven-publish'
6+
7+
alias libs.plugins.versions
8+
}
9+
10+
wrapper {
11+
gradleVersion = '8.7'
12+
}
13+
14+
15+
group 'me.modeled'
16+
version '0.1.0-SNAPSHOT'
17+
18+
java {
19+
sourceCompatibility = 17
20+
targetCompatibility = 17
21+
}
22+
23+
24+
repositories {
25+
mavenLocal()
26+
mavenCentral()
27+
}
28+
29+
dependencies {
30+
gradleApi()
31+
localGroovy()
32+
33+
api libs.streamex
34+
35+
implementation libs.handlebars
36+
implementation libs.javapoet
37+
implementation libs.throwing.function
38+
39+
annotationProcessor libs.auto.service
40+
implementation libs.auto.service
41+
42+
annotationProcessor libs.lombok
43+
compileOnly libs.lombok
44+
}
45+
46+
47+
import com.github.benmanes.gradle.versions.reporter.PlainTextReporter
48+
49+
dependencyUpdates {
50+
outputFormatter { /** Combining custom with default output was adapted from:
51+
https://github.com/ben-manes/gradle-versions-plugin/issues/566#issuecomment-961929993
52+
*/
53+
new PlainTextReporter(project, revision, gradleReleaseChannel).write System.out, it
54+
55+
final outdated = it.outdated.dependencies.findAll { !(it.name.startsWith 'spock-') }
56+
if (outdated != it.outdated.dependencies) {
57+
println "\nIgnoring outdated Spock dependencies."
58+
}
59+
60+
if (outdated) {
61+
throw new RuntimeException("Outdated dependencies: ${outdated.collect { it.name }}")
62+
}
63+
}
64+
}
65+
66+
67+
publishing {
68+
publications {
69+
maven MavenPublication, {
70+
from components.java
71+
}
72+
}
73+
}

lombok.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lombok.log.fieldName = LOG

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'modeled-java'

src/main/java/me/modeled/Modeled.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/** MODELED-Java
2+
3+
Copyright 2024 Stefan Zimmermann <[email protected]>
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package me.modeled;
19+
20+
import java.lang.annotation.ElementType;
21+
import java.lang.annotation.Retention;
22+
import java.lang.annotation.RetentionPolicy;
23+
import java.lang.annotation.Target;
24+
25+
26+
@Retention(RetentionPolicy.SOURCE) @Target({ElementType.TYPE})
27+
public @interface Modeled {
28+
29+
@Retention(RetentionPolicy.SOURCE) @Target({ElementType.FIELD})
30+
@interface Property {
31+
32+
boolean immutable() default false;
33+
}
34+
}

0 commit comments

Comments
 (0)