Skip to content

Commit b3c2a69

Browse files
authored
Rename master to multivariant (#72)
* upgrade gradle * master -> multivariant (fix #44) * set sourceCompatibility to 1.8
1 parent 5748dc5 commit b3c2a69

28 files changed

Lines changed: 430 additions & 338 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
build
22
out
3+
.gradle

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ implementation 'io.lindstrom:m3u8-parser:0.29'
3131

3232
## Usage
3333

34-
### Create master playlist
34+
### Create multivariant playlist
3535
```java
36-
MasterPlaylist playlist = MasterPlaylist.builder()
36+
MultivariantPlaylist playlist = MultivariantPlaylist.builder()
3737
.version(4)
3838
.independentSegments(true)
3939
.addAlternativeRenditions(AlternativeRendition.builder()
@@ -55,11 +55,11 @@ MasterPlaylist playlist = MasterPlaylist.builder()
5555
.build())
5656
.build();
5757

58-
MasterPlaylistParser parser = new MasterPlaylistParser();
58+
MultivariantPlaylistParser parser = new MultivariantPlaylistParser();
5959
System.out.println(parser.writePlaylistAsString(playlist));
6060
```
6161

62-
This code should produce the following master playlist:
62+
This code should produce the following multivariant playlist:
6363
```
6464
#EXTM3U
6565
#EXT-X-VERSION:4
@@ -113,15 +113,15 @@ http://media.example.com/third.ts
113113
#EXT-X-ENDLIST
114114
```
115115

116-
### Parse master playlist
116+
### Parse multivariant playlist
117117
```java
118-
MasterPlaylistParser parser = new MasterPlaylistParser();
118+
MultivariantPlaylistParser parser = new MultivariantPlaylistParser();
119119

120120
// Parse playlist
121-
MasterPlaylist playlist = parser.readPlaylist(Paths.get("path/to/master.m3u8"));
121+
MultivariantPlaylist playlist = parser.readPlaylist(Paths.get("path/to/multivariant.m3u8"));
122122

123123
// Update playlist version
124-
MasterPlaylist updated = MasterPlaylist.builder()
124+
MultivariantPlaylist updated = Multivariant.builder()
125125
.from(playlist)
126126
.version(2)
127127
.build();
@@ -153,7 +153,7 @@ By default, the parser will throw an exception on unsupported tags and attribute
153153
passing a `ParsingMode` to the parser. Example:
154154

155155
```java
156-
MasterPlaylistParser lenientParser = new MasterPlaylistParser(ParsingMode.LENIENT);
156+
MultivariantPlaylistParser lenientParser = new MultivariantPlaylistParser(ParsingMode.LENIENT);
157157
```
158158

159159
Currently two modes are available:

build.gradle

Lines changed: 60 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
group 'io.lindstrom'
2-
version '0.29'
1+
plugins {
2+
id 'idea'
3+
id 'java-library'
4+
id 'maven-publish'
5+
id 'signing'
6+
}
7+
8+
group = 'io.lindstrom'
9+
version = '0.29'
310

4-
apply plugin: 'idea'
5-
apply plugin: 'java'
6-
apply plugin: 'maven'
7-
apply plugin: 'signing'
11+
java {
12+
sourceCompatibility = JavaVersion.VERSION_1_8
13+
withJavadocJar()
14+
withSourcesJar()
15+
}
816

917
ext {
1018
ideaGeneratedSources = file('build/generated/sources/annotationProcessor/java')
@@ -15,81 +23,76 @@ idea.module {
1523
generatedSourceDirs += ideaGeneratedSources
1624
}
1725

18-
sourceCompatibility = 1.8
19-
2026
repositories {
2127
mavenCentral()
2228
}
2329

2430
dependencies {
25-
compileOnly 'org.immutables:value:2.5.6'
31+
compileOnly 'org.immutables:value:2.10.1'
2632
annotationProcessor "org.immutables:value:2.5.6"
27-
testCompile 'junit:junit:4.12'
33+
testImplementation('junit:junit:4.12')
2834
}
2935

30-
task javadocJar(type: Jar) {
31-
classifier = 'javadoc'
32-
from javadoc
36+
test {
37+
//useJUnitPlatform()
3338
}
3439

35-
task sourcesJar(type: Jar) {
36-
classifier = 'sources'
37-
from sourceSets.main.allSource
38-
}
40+
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
3941

40-
artifacts {
41-
archives javadocJar, sourcesJar
42-
}
42+
publishing {
43+
repositories {
44+
maven {
45+
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
46+
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
4347

44-
archivesBaseName = "m3u8-parser"
48+
name = "OSSRH"
49+
url = isReleaseVersion ? releaseRepo : snapshotRepo
4550

46-
if (project.hasProperty('ossrhUsername')) {
47-
signing {
48-
sign configurations.archives
51+
credentials {
52+
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
53+
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
54+
}
55+
}
4956
}
5057

51-
uploadArchives {
52-
repositories {
53-
mavenDeployer {
54-
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
58+
publications {
59+
mavenJava(MavenPublication) {
60+
artifactId = 'm3u8-parser'
5561

56-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
57-
authentication(userName: ossrhUsername, password: ossrhPassword)
58-
}
62+
from components.java
5963

60-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
61-
authentication(userName: ossrhUsername, password: ossrhPassword)
62-
}
64+
pom {
65+
groupId = 'io.lindstrom'
66+
name = 'm3u8-parser'
67+
description = 'm3u8 parser'
68+
url = 'https://github.com/carlanton/m3u8-parser'
69+
packaging = 'jar'
6370

64-
pom.project {
65-
name 'm3u8-parser'
66-
packaging 'jar'
67-
artifactId 'm3u8-parser'
68-
description 'm3u8 parser'
69-
url 'https://github.com/carlanton/m3u8-parser'
70-
71-
scm {
72-
connection 'scm:git:https://github.com/carlanton/m3u8-parser.git'
73-
developerConnection 'scm:git:git@github.com:carlanton/m3u8-parser.git'
74-
url 'https://github.com/carlanton/m3u8-parser.git'
71+
licenses {
72+
license {
73+
name = 'MIT License'
74+
url = 'https://github.com/carlanton/m3u8-parser/blob/master/LICENSE'
7575
}
76+
}
7677

77-
licenses {
78-
license {
79-
name 'MIT License'
80-
url 'https://github.com/carlanton/m3u8-parser/blob/master/LICENSE'
81-
}
82-
}
78+
scm {
79+
url = 'https://github.com/carlanton/m3u8-parser.git'
80+
connection = 'scm:git:https://github.com/carlanton/m3u8-parser.git'
81+
developerConnection = 'scm:git:git@github.com:carlanton/m3u8-parser.git'
82+
}
8383

84-
developers {
85-
developer {
86-
id 'antonlindstrom'
87-
name 'Anton Lindström'
88-
email 'carlantonlindstrom@gmail.com'
89-
}
84+
developers {
85+
developer {
86+
id = 'antonlindstrom'
87+
name = 'Anton Lindström'
88+
email = 'carlantonlindstrom@gmail.com'
9089
}
9190
}
9291
}
9392
}
9493
}
9594
}
95+
96+
signing {
97+
sign publishing.publications.mavenJava
98+
}

gradle/wrapper/gradle-wrapper.jar

-10.7 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
36
zipStoreBase=GRADLE_USER_HOME
47
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip

0 commit comments

Comments
 (0)