Skip to content

Commit d65b18c

Browse files
committed
Revert changes moved to the gradle branch
The features added in the commits after 3cfc4b2 were moved to the `gradle` branch. As such, this commit resets the branch at the point of the 1.3.0 release.
1 parent 5386c74 commit d65b18c

File tree

13 files changed

+11
-950
lines changed

13 files changed

+11
-950
lines changed

bukkit/src/main/java/net/byteflux/libby/BukkitLibraryManager.java

-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import net.byteflux.libby.logging.adapters.JDKLogAdapter;
55
import org.bukkit.plugin.Plugin;
66

7-
import java.io.InputStream;
87
import java.net.URLClassLoader;
98
import java.nio.file.Path;
109

@@ -18,7 +17,6 @@ public class BukkitLibraryManager extends LibraryManager {
1817
* Plugin classpath helper
1918
*/
2019
private final URLClassLoaderHelper classLoader;
21-
private final Plugin plugin;
2220

2321
/**
2422
* Creates a new Bukkit library manager.
@@ -38,7 +36,6 @@ public BukkitLibraryManager(Plugin plugin) {
3836
public BukkitLibraryManager(Plugin plugin, String directoryName) {
3937
super(new JDKLogAdapter(requireNonNull(plugin, "plugin").getLogger()), plugin.getDataFolder().toPath(), directoryName);
4038
classLoader = new URLClassLoaderHelper((URLClassLoader) plugin.getClass().getClassLoader(), this);
41-
this.plugin = plugin;
4239
}
4340

4441
/**
@@ -50,9 +47,4 @@ public BukkitLibraryManager(Plugin plugin, String directoryName) {
5047
protected void addToClasspath(Path file) {
5148
classLoader.addToClasspath(file);
5249
}
53-
54-
@Override
55-
protected InputStream getPluginResourceAsInputStream(String path) {
56-
return plugin.getResource(path);
57-
}
5850
}

bungee/src/main/java/net/byteflux/libby/BungeeLibraryManager.java

-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import net.byteflux.libby.logging.adapters.JDKLogAdapter;
55
import net.md_5.bungee.api.plugin.Plugin;
66

7-
import java.io.InputStream;
87
import java.net.URLClassLoader;
98
import java.nio.file.Path;
109

@@ -19,8 +18,6 @@ public class BungeeLibraryManager extends LibraryManager {
1918
*/
2019
private final URLClassLoaderHelper classLoader;
2120

22-
private final Plugin plugin;
23-
2421
/**
2522
* Creates a new Bungee library manager.
2623
*
@@ -39,12 +36,6 @@ public BungeeLibraryManager(Plugin plugin) {
3936
public BungeeLibraryManager(Plugin plugin, String directoryName) {
4037
super(new JDKLogAdapter(requireNonNull(plugin, "plugin").getLogger()), plugin.getDataFolder().toPath(), directoryName);
4138
classLoader = new URLClassLoaderHelper((URLClassLoader) plugin.getClass().getClassLoader(), this);
42-
this.plugin = plugin;
43-
}
44-
45-
@Override
46-
protected InputStream getPluginResourceAsInputStream(String path) throws UnsupportedOperationException {
47-
return plugin.getResourceAsStream(path);
4839
}
4940

5041
/**

core/pom.xml

+1-42
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,6 @@
1212

1313
<artifactId>libby-core</artifactId>
1414

15-
<dependencies>
16-
<dependency>
17-
<groupId>org.apache.maven.resolver</groupId>
18-
<artifactId>maven-resolver-supplier</artifactId>
19-
<version>1.9.15</version>
20-
<scope>provided</scope>
21-
</dependency>
22-
<dependency>
23-
<groupId>org.apache.maven</groupId>
24-
<artifactId>maven-resolver-provider</artifactId>
25-
<version>3.9.4</version>
26-
<scope>provided</scope>
27-
</dependency>
28-
<dependency>
29-
<groupId>com.grack</groupId>
30-
<artifactId>nanojson</artifactId>
31-
<version>1.7</version>
32-
</dependency>
33-
</dependencies>
34-
3515
<build>
3616
<plugins>
3717
<plugin>
@@ -60,27 +40,6 @@
6040
</archive>
6141
</configuration>
6242
</plugin>
63-
<plugin>
64-
<groupId>org.apache.maven.plugins</groupId>
65-
<artifactId>maven-shade-plugin</artifactId>
66-
<version>3.5.0</version>
67-
<executions>
68-
<execution>
69-
<phase>package</phase>
70-
<goals>
71-
<goal>shade</goal>
72-
</goals>
73-
<configuration>
74-
<relocations>
75-
<relocation>
76-
<pattern>com.grack.nanojson</pattern>
77-
<shadedPattern>net.byteflux.libby.nanojson</shadedPattern>
78-
</relocation>
79-
</relocations>
80-
</configuration>
81-
</execution>
82-
</executions>
83-
</plugin>
8443
</plugins>
8544
</build>
86-
</project>
45+
</project>

core/src/main/java/net/byteflux/libby/Library.java

+4-84
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package net.byteflux.libby;
22

33
import net.byteflux.libby.relocation.Relocation;
4-
import net.byteflux.libby.transitive.ExcludedDependency;
54

65
import java.util.Base64;
76
import java.util.Collection;
@@ -83,16 +82,6 @@ public class Library {
8382
*/
8483
private final boolean isolatedLoad;
8584

86-
/**
87-
* Should transitive dependencies be resolved for this library?
88-
*/
89-
private final boolean resolveTransitiveDependencies;
90-
91-
/**
92-
* Transitive dependencies that would be excluded on transitive resolvement
93-
*/
94-
private final Collection<ExcludedDependency> excludedTransitiveDependencies;
95-
9685
/**
9786
* Creates a new library.
9887
*
@@ -105,8 +94,6 @@ public class Library {
10594
* @param checksum binary SHA-256 checksum or null
10695
* @param relocations jar relocations or null
10796
* @param isolatedLoad isolated load for this library
108-
* @param resolveTransitiveDependencies transitive dependencies resolvement for this library
109-
* @param excludedTransitiveDependencies excluded transitive dependencies or null
11097
*/
11198
private Library(Collection<String> urls,
11299
String id,
@@ -116,11 +103,9 @@ private Library(Collection<String> urls,
116103
String classifier,
117104
byte[] checksum,
118105
Collection<Relocation> relocations,
119-
boolean isolatedLoad,
120-
boolean resolveTransitiveDependencies,
121-
Collection<ExcludedDependency> excludedTransitiveDependencies) {
106+
boolean isolatedLoad) {
122107

123-
this(urls, null, id, groupId, artifactId, version, classifier, checksum, relocations, isolatedLoad, resolveTransitiveDependencies, excludedTransitiveDependencies);
108+
this(urls, null, id, groupId, artifactId, version, classifier, checksum, relocations, isolatedLoad);
124109
}
125110

126111
/**
@@ -136,8 +121,6 @@ private Library(Collection<String> urls,
136121
* @param checksum binary SHA-256 checksum or null
137122
* @param relocations jar relocations or null
138123
* @param isolatedLoad isolated load for this library
139-
* @param resolveTransitiveDependencies transitive dependencies resolvement for this library
140-
* @param excludedTransitiveDependencies excluded transitive dependencies or null
141124
*/
142125
private Library(Collection<String> urls,
143126
Collection<String> repositories,
@@ -148,9 +131,7 @@ private Library(Collection<String> urls,
148131
String classifier,
149132
byte[] checksum,
150133
Collection<Relocation> relocations,
151-
boolean isolatedLoad,
152-
boolean resolveTransitiveDependencies,
153-
Collection<ExcludedDependency> excludedTransitiveDependencies) {
134+
boolean isolatedLoad) {
154135

155136
this.urls = urls != null ? Collections.unmodifiableList(new LinkedList<>(urls)) : Collections.emptyList();
156137
this.id = id != null ? id : UUID.randomUUID().toString();
@@ -172,8 +153,6 @@ private Library(Collection<String> urls,
172153
this.repositories = repositories != null ? Collections.unmodifiableList(new LinkedList<>(repositories)) : Collections.emptyList();
173154
relocatedPath = hasRelocations() ? path + "-relocated.jar" : null;
174155
this.isolatedLoad = isolatedLoad;
175-
this.resolveTransitiveDependencies = resolveTransitiveDependencies;
176-
this.excludedTransitiveDependencies = excludedTransitiveDependencies != null ? Collections.unmodifiableList(new LinkedList<>(excludedTransitiveDependencies)) : Collections.emptyList();
177156
}
178157

179158
/**
@@ -329,19 +308,6 @@ public boolean isSnapshot() {
329308
return version.endsWith("-SNAPSHOT");
330309
}
331310

332-
/**
333-
* Should transitive dependencies of this resolved
334-
*
335-
* @return true if the transitive dependencies of this library would be resolved
336-
*/
337-
public boolean resolveTransitiveDependencies() {
338-
return resolveTransitiveDependencies;
339-
}
340-
341-
public Collection<ExcludedDependency> getExcludedTransitiveDependencies() {
342-
return excludedTransitiveDependencies;
343-
}
344-
345311
/**
346312
* Gets a concise, human-readable string representation of this library.
347313
*
@@ -422,16 +388,6 @@ public static class Builder {
422388
*/
423389
private final Collection<Relocation> relocations = new LinkedList<>();
424390

425-
/**
426-
* Resolve transitive dependencies
427-
*/
428-
private boolean resolveTransitiveDependencies;
429-
430-
/**
431-
* Resolve transitive dependencies exclusions
432-
*/
433-
private final Collection<ExcludedDependency> excludedTransitiveDependencies = new LinkedList<>();
434-
435391
/**
436392
* Adds a direct download URL for this library.
437393
*
@@ -565,49 +521,13 @@ public Builder relocate(String pattern, String relocatedPattern) {
565521
return relocate(new Relocation(pattern, relocatedPattern));
566522
}
567523

568-
/**
569-
* Sets the transitive dependency resolvement for this library.
570-
*
571-
* @param resolveTransitiveDependencies the transitive dependency resolvement
572-
* @return this builder
573-
* @see #excludeTransitiveDependency(ExcludedDependency)
574-
*/
575-
public Builder resolveTransitiveDependencies(boolean resolveTransitiveDependencies) {
576-
this.resolveTransitiveDependencies = resolveTransitiveDependencies;
577-
return this;
578-
}
579-
580-
/**
581-
* Excludes transitive dependency for this library.
582-
*
583-
* @param excludedDependency Excluded transitive dependency
584-
* @return this builder
585-
* @see #resolveTransitiveDependencies(boolean)
586-
*/
587-
public Builder excludeTransitiveDependency(ExcludedDependency excludedDependency) {
588-
excludedTransitiveDependencies.add(excludedDependency);
589-
return this;
590-
}
591-
592-
/**
593-
* Excludes transitive dependency for this library.
594-
*
595-
* @param groupId Excluded transitive dependency group ID
596-
* @param artifactId Excluded transitive dependency artifact ID
597-
* @return this builder
598-
* @see #excludeTransitiveDependency(ExcludedDependency)
599-
*/
600-
public Builder excludeTransitiveDependency(String groupId, String artifactId) {
601-
return excludeTransitiveDependency(new ExcludedDependency(groupId, artifactId));
602-
}
603-
604524
/**
605525
* Creates a new library using this builder's configuration.
606526
*
607527
* @return new library
608528
*/
609529
public Library build() {
610-
return new Library(urls, repositories, id, groupId, artifactId, version, classifier, checksum, relocations, isolatedLoad, resolveTransitiveDependencies, excludedTransitiveDependencies);
530+
return new Library(urls, repositories, id, groupId, artifactId, version, classifier, checksum, relocations, isolatedLoad);
611531
}
612532
}
613533
}

0 commit comments

Comments
 (0)