File tree Expand file tree Collapse file tree 4 files changed +26
-21
lines changed
main/java/software/amazon/smithy/java/mcp/server
test/java/software/amazon/smithy/java/mcp/server Expand file tree Collapse file tree 4 files changed +26
-21
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ interface Injected {
63
63
}
64
64
65
65
fun AbstractCopyTask.configureServiceFileMerging () {
66
- val serviceEntries = mutableMapOf<String , MutableList <String >>()
66
+ val serviceEntries = mutableMapOf<String , MutableSet <String >>()
67
67
val tempServicesDir = temporaryDir // Capture at configuration time
68
68
69
69
// Configure Jar tasks to include temp directory at configuration time
@@ -76,7 +76,7 @@ fun AbstractCopyTask.configureServiceFileMerging() {
76
76
val serviceName = path.substring(" META-INF/services/" .length)
77
77
78
78
if (! serviceEntries.containsKey(serviceName)) {
79
- serviceEntries[serviceName] = mutableListOf ()
79
+ serviceEntries[serviceName] = mutableSetOf ()
80
80
}
81
81
82
82
serviceEntries[serviceName]!! .addAll(
@@ -102,7 +102,7 @@ fun AbstractCopyTask.configureServiceFileMerging() {
102
102
103
103
serviceEntries.forEach { (serviceName, lines) ->
104
104
val serviceFile = File (servicesDir, serviceName)
105
- serviceFile.writeText(lines.distinct(). joinToString(" \n " ) + " \n " )
105
+ serviceFile.writeText(lines.joinToString(" \n " ) + " \n " )
106
106
}
107
107
}
108
108
}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
1
6
package software .amazon .smithy .java .mcp .server ;
2
7
3
8
import software .amazon .smithy .java .mcp .model .PromptInfo ;
4
9
5
- public record Prompt (PromptInfo promptInfo , String promptTemplate ) {
6
- }
10
+ public record Prompt (PromptInfo promptInfo , String promptTemplate ) {}
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
1
6
package software .amazon .smithy .java .mcp .server ;
2
7
3
- import org .junit .jupiter .api .Test ;
4
- import software .amazon .smithy .java .server .ProxyService ;
5
- import software .amazon .smithy .java .server .Service ;
8
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
6
9
7
10
import java .util .Collections ;
8
-
9
- import static org .junit .jupiter .api .Assertions .assertTrue ;
11
+ import org .junit .jupiter .api .Test ;
10
12
11
13
class PromptLoaderTest {
12
14
@@ -15,4 +17,4 @@ public void testLoadPromptsWithNoServices() {
15
17
var prompts = PromptLoader .loadPrompts (Collections .emptyList ());
16
18
assertTrue (prompts .isEmpty ());
17
19
}
18
- }
20
+ }
Original file line number Diff line number Diff line change @@ -86,16 +86,6 @@ include(":aws:sdkv2:aws-sdkv2-retries")
86
86
include(" :aws:sdkv2:aws-sdkv2-shapes" )
87
87
include(" :aws:sdkv2:aws-sdkv2-auth" )
88
88
89
-
90
- // MCP
91
- include(" :mcp" )
92
- include(" :mcp:mcp-schemas" )
93
- include(" :mcp:mcp-server" )
94
- include(" :mcp:mcp-cli" )
95
- include(" :mcp:mcp-cli-api" )
96
- include(" :mcp:mcp-bundle-api" )
97
- include(" :mcp:mcp-traits" )
98
-
99
89
// Examples
100
90
include(" :examples" )
101
91
include(" :examples:basic-server" )
@@ -108,5 +98,14 @@ include(":examples:standalone-types")
108
98
include(" :examples:mcp-server" )
109
99
include(" :examples:mcp-traits-example" )
110
100
101
+ // MCP
102
+ include(" :mcp" )
103
+ include(" :mcp:mcp-schemas" )
104
+ include(" :mcp:mcp-server" )
105
+ include(" :mcp:mcp-cli" )
106
+ include(" :mcp:mcp-cli-api" )
107
+ include(" :mcp:mcp-bundle-api" )
108
+ include(" :mcp:mcp-traits" )
109
+
111
110
include(" :model-bundle" )
112
111
include(" :model-bundle:model-bundle-api" )
You can’t perform that action at this time.
0 commit comments