-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #193 from bugsnag/release/v3.7.0
- Loading branch information
Showing
108 changed files
with
2,786 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.4.1 | ||
2.7.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v6.8.0' | ||
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.24.0' | ||
gem 'os' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ext { | ||
springVersion = '5.3.20' | ||
springBootVersion = '2.5.14' | ||
} | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'java-library' | ||
|
||
apply from: '../../common.gradle' | ||
|
||
compileJava { | ||
sourceCompatibility = '1.8' | ||
targetCompatibility = '1.8' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
api project(':bugsnag') | ||
testImplementation project(':bugsnag').sourceSets.test.output | ||
|
||
compileOnly "javax.servlet:javax.servlet-api:${javaxServletApiVersion}" | ||
compileOnly "org.springframework:spring-webmvc:${springVersion}" | ||
compileOnly "org.springframework.boot:spring-boot:${springBootVersion}" | ||
compileOnly "ch.qos.logback:logback-core:${logbackVersion}" | ||
compileOnly "org.slf4j:slf4j-api:${slf4jApiVersion}" | ||
|
||
testImplementation "junit:junit:${junitVersion}" | ||
testImplementation "javax.servlet:javax.servlet-api:${javaxServletApiVersion}" | ||
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}" | ||
testImplementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}" | ||
testImplementation "org.mockito:mockito-core:${mockitoVersion}" | ||
} |
File renamed without changes.
54 changes: 54 additions & 0 deletions
54
bugsnag-spring/javax/src/main/java/com/bugsnag/BugsnagImportSelector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.bugsnag; | ||
|
||
import org.springframework.context.annotation.ImportSelector; | ||
import org.springframework.core.SpringVersion; | ||
import org.springframework.core.type.AnnotationMetadata; | ||
|
||
public class BugsnagImportSelector implements ImportSelector { | ||
|
||
private static final String[] SPRING_JAKARTA_CLASSES = { | ||
"com.bugsnag.SpringBootJakartaConfiguration", | ||
"com.bugsnag.JakartaMvcConfiguration", | ||
"com.bugsnag.ScheduledTaskConfiguration" | ||
}; | ||
|
||
private static final String[] SPRING_JAVAX_CLASSES = { | ||
"com.bugsnag.SpringBootJavaxConfiguration", | ||
"com.bugsnag.JavaxMvcConfiguration", | ||
"com.bugsnag.ScheduledTaskConfiguration" | ||
}; | ||
|
||
@Override | ||
public String[] selectImports(AnnotationMetadata importingClassMetadata) { | ||
if (isSpringJakartaCompatible() && isJava17Compatible()) { | ||
return SPRING_JAKARTA_CLASSES; | ||
} | ||
|
||
return SPRING_JAVAX_CLASSES; | ||
} | ||
|
||
private static boolean isSpringJakartaCompatible() { | ||
return getMajorVersion(SpringVersion.getVersion()) >= 6; | ||
} | ||
|
||
private static boolean isJava17Compatible() { | ||
return getMajorVersion(System.getProperty("java.version")) >= 17; | ||
} | ||
|
||
private static int getMajorVersion(String version) { | ||
if (version == null) { | ||
return 0; | ||
} | ||
int firstDot = version.indexOf("."); | ||
if (firstDot == -1) { | ||
return 0; | ||
} | ||
|
||
String majorVersion = version.substring(0, firstDot); | ||
try { | ||
return Integer.parseInt(majorVersion); | ||
} catch (NumberFormatException nfe) { | ||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.